codeRIT/hackathon-manager

Create a custom ErrorResponse class

cbaudouinjr opened this issue · 0 comments

This custom error class will be responsible for providing details on errors sent to the front-end. The JSON format of the ErrorResponse class is below.

{
    error_identifier: "login.incorrectPassword", 
    default_message: "Your password is incorrect."
}

default_message should be optional. For v3 of the API the front-end should always expect an HTTP status code and an optional ErrorResponse. We plan to slowly roll out ErrorResponse to more errors over time. In regards to i18n, the front-end should handle localization whenever possible, if not possible the back-end may offer a localized default message but this isn't always guaranteed.