1.0.2 • Published 3 years ago
@joaomelo/errors v1.0.2
error utils for projects
reportOn
create a error report object based on passed error and schema. the schema is a map of keys and (code or codes) associated with these keys.
the report is an object with all of schema fields as keys and null or an actual error code as value.
an additional "escaped" special field is included for error codes with no related field found in the schema. is schema is not passed, escaped is the only key with possible value.
this is useful to map commands errors to fields in a form interface.
AppError
errors with a code attached to them.
this code data make ui tasks like i18n easier to handle.
1.0.2
3 years ago