Home Reference Source
public class | source

SkygearError

Extends:

Error → SkygearError

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.

Member Summary

Public Members
public

code: *

public

info: *

public

message: *

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:

NameTypeAttributeDescription
attrs Object

the JSON object

attrs.message String

an error message

attrs.code Number
  • optional

a code for the error condition

attrs.info Object
  • optional

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:

NameTypeAttributeDescription
message string

an error message

code number

a code for the error condition

info Object

more information about the error

Public Members

public code: * source

public info: * source

public message: * source

Public Methods

public toJSON(): Object source

Serializes SkyearError to a JSON object.

Return:

Object

the JSON object

public toLocaleString(): String source

Description of the error code of the error

Return:

String

description

public toString(): String source

Description of the error

Return:

String

description