- To represent remote Errors.
- To enable graceful fallback.
- To conform to Javascript standards.
name
- A high level summary of what went wrong.message
- A more detailed message of specifically what went wrong.status
- The HTTP response code, useful for distinguishing between user errors or API bugs.code
- Useful for debugging the remote API, should assist development teams to track down bugs.
> console.log(someError);
{ [Requested resource does not exist: "There is no people with id 5e7b30d5-c8da-4936-9f81-4a6ea1153a5f"]
name: 'Requested resource does not exist',
status: '404',
code: 'ENOTFOUND' }