Skip to content

Describe approach of error handling #307

@vasilii-kovalev

Description

@vasilii-kovalev

Currently, the documentation doesn't state any approach of how to handle errors.

Topics to cover:

  1. What is the format of errors? Do they have different types (extensions of Error object)? Do they have unique error codes, like Prisma does?
  2. Does a model have built-in validators depending on provided meta-data (like type)? Can users define custom validators? Can they customize errors? If so, can they customize only error messages, or they can return a custom structure? Or should they validate data passed to the model beforehand (using Zod, for example), because the library's scope will be intentionally small?
  3. Is there a difference of handling validation errors (via a dedicated validate method, for example) and other errors? Or are they all handled the same way, like in Prisma?

Even though the library will be rewritten, as mentioned in #285, this information will still be necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions