Created
Apr 8, 2022 8:13 AM
Department
Engineering
Category
Security
Technology
Ruby on Rails
Tags
Date
URL
It’s very important to have a standardized set of error codes and messages in a platform to ensure that the frontend and backend are aligned on how to handle different situations and react accordingly.
The table below has the following components
- Code - A larger level grouping of the error similar to the status codes used in HTTP responses
- Sub Code - A sub-set of the code identifying the specific error for a system.
- Message - A message that can be shown to the end-user.
Some common errors are described here and are supported by the following application templates
- Commutatus Rails Templates
- Commutatus Angular Starter Pack
- Commutatus React Boilerplate
Name | Code | Sub-code | Message | Comments |
---|---|---|---|---|
unauthorized | invalid_login_combination | Incorrect email/password combination | ||
unauthorized | invalid_access_token | |||
unauthorized | permission_denied | |||
internal_server_error | internal_server_error | We normally also return the Rollbar UUID | ||
unprocessable_entity | record_invalid | e.message from ActiveRecord |