Error and Result handling
libqaul spans over a huge abstraction surface, from drivers all
the way to “business logic” functions in the service API (see
api module). This makes communicating errors challenging at
times. Generally, no lower layer
Error objects are wrapped here,
to avoid introducing new dependencies in service code.
Error attempts to provide a comprehensive set of
failures modes, that can be returned to communicate a failure,
that then needs tobe interpreted and addressed by an implementing
application. This way, it becomes easier for your service to
wrap errors, or to enumerate them more easily.
Error enum, it is also possible to call
get a plain text error description of what went wrong, and what it
probably means. These are meant to simplify front-end development
and avoid having applications return arbitrary codes. You can also
QAUL_LANG=ar (or others) as an environment variable to get
translations of these messages, with
en being the fallback.