SkygearError
Extends:
SkygearError is an error object containing information of an error occurred.
Example:
let err = new SkygearError(
'Unable to parse data',
UnexpectedError,
{ content: 'BADDATA' }
);
Static Method Summary
| Static Public Methods | ||
| public static |
fromJSON(attrs: Object): SkyearError Constructs a new SkyearError object from JSON object. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(message: string, code: number, info: Object) Creates a SkygearError. |
|
Method Summary
| Public Methods | ||
| public |
toJSON(): Object Serializes SkyearError to a JSON object. |
|
| public |
toLocaleString(): String Description of the error code of the error |
|
| public |
toString(): String Description of the error |
|
Static Public Methods
public static fromJSON(attrs: Object): SkyearError source
Constructs a new SkyearError object from JSON object.
Params:
| Name | Type | Attribute | Description |
| attrs | Object | the JSON object |
|
| attrs.message | String | an error message |
|
| attrs.code | Number |
|
a code for the error condition |
| attrs.info | Object |
|
more information about the error |
Return:
| SkyearError | the created SkyearError object |
Public Constructors
public constructor(message: string, code: number, info: Object) source
Creates a SkygearError.
Params:
| Name | Type | Attribute | Description |
| message | string | an error message |
|
| code | number | a code for the error condition |
|
| info | Object | more information about the error |
