Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 462 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 462 Bytes

HTTP-code specific classes to format unified AJAX error response

For NodeJS, Typescript applications.

Return unified response on backend error.

HTTP code 400, 404, 5xx

Response:

{
  "code": "NotFound",
  "message": "Requested entity is not found"
}

HTTP code 422 request payload validation error

Response:

{
  "code": "Validation",
  "validationErrors": {
    "field": ["Field is required", "Value must be integer"]
  }
}