Constructor
new ResponseError(data)
ResponseError constructor
Parameters:
Properties| Name | Type | Description |
|---|---|---|
data | Object | |
| Name | Type | Description |
|---|---|---|
message | String | Error message |
code | String | | Error code |
requestId | String | Request ID |
details | String | | Error details |
- Source
Members
status
Error status
- Source
404 Not Found451 Unavailable For Legal Reasons500 Internal Server ErrorMethods
toJSON() → {Object}
Plain object representation of the error
- Source
Returns:
- Type:
- Object
Example
// returned JSON
{
error: {
code: 400,
requestId: '123456-test-request-id',
message: 'Baaaaaad Request :-(',
details: 'Check your request body'
}
}toPojo() → {Object}
Plain object representation of the error
- Source
Returns:
- Type:
- Object
Example
// returned object
{
error: {
code: 400,
requestId: '123456-test-request-id',
message: 'Baaaaaad Request :-(',
details: 'Check your request body'
}
}toString() → {string}
String representation of the error
- Source
Returns:
- Type:
- string
Example
// returned string
{"error":{"code":400,"requestId":"123456-test-request-id","message":"Baaaaaad Request :-(","details":"Check your request body"}}