API Error

We provide a custom error object that is utilized throughout the library.

Error and HTTP Codes

We employ semantic HTTP codes to signify the type of error that occurred, enabling more precise error handling.
If HTTP codes lack granularity, we offer a custom error code for more specific error handling scenarios. By default, HTTP codes are used.

Custom Error Codes

Custom error codes come into play when HTTP codes lack granularity. For instance, if you need to handle a particular error in a specific manner, custom error codes allow for such tailored handling.
Custom error codes always consist of at least four digits to prevent conflicts with HTTP codes.
We call these custom error codes Api Codes.

Api Codes

CodeDescription
1000Invalid Session
1002Invalid credentials provided
1003Unauthorized
1004No bearer token provided

User-causes errors

CodeDescription
1100Resource not found
1101Serialization error
1102Missing permissions
1103Error while parsing to cron

Validation errors

CodeDescription
1200Validation error!

Internal server errors

CodeDescription
1300DB-Entitiy error
1301Database error
1302Redis error
1303Cron builder error
1304An internal time-error
1305An internal error that occurs when a snowflake could not be generated!

Misc errors

CodeDescription
9000Actix error
9999Unknown error

Validation Codes

Validation codes are just like Api Codes but instead of just a number, they contain String code and a message.
They are used to provide more detailed information about the validation-error that occurred.