cc-everywhere

Class: CCEverywhereError<T>

Extends

Type Parameters

Type Parameter
T

Constructors

Constructor

new CCEverywhereError<T>(
   code, 
   message?, 
   subError?, 
customData?): CCEverywhereError<T>;

Constructor

Parameters

Parameter
Type
Description
code
T
The error code associated with this error.
message?
string
The message associated with this error.
subError?
string | number | Error
Source error or a number tell more about the error.
customData?
unknown
Any kind of custom data related to error, which is converted to valid JSON

Returns

CCEverywhereError<T>

Overrides

Error.constructor

Accessors

code

Get Signature

get code(): T;

getter code

Returns

T

Methods

create()

static create<T>(
   errorCodeMessage, 
   subError?, 
customData?): CCEverywhereError<T>;

Type Parameters

Type Parameter
T

Parameters

Parameter
Type
errorCodeMessage
ErrorCodeMessage<T>
subError?
string | number | Error
customData?
unknown

Returns

CCEverywhereError<T>

createErrorFromData()

static createErrorFromData<T>(data): CCEverywhereError<T>;

Type Parameters

Type Parameter
T

Parameters

Parameter
Type
data
ErrorData<T>

Returns

CCEverywhereError<T>

toData()

toData(): ErrorData<T>;

Get a plain-object representation of the error..

Returns

ErrorData<T>

toString()

toString(): string;

Get complete message

Returns

string