Constructor
new ResponseError(data)
ResponseError constructor
Parameters:
PropertiesName | 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 Found
451 Unavailable For Legal Reasons
500 Internal Server Error
Methods
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"}}