data icon indicating copy to clipboard operation
data copied to clipboard

Describe approach of error handling

Open vasilii-kovalev opened this issue 1 year ago • 0 comments

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.

vasilii-kovalev avatar Nov 10 '24 10:11 vasilii-kovalev