Class: MNotifyError
Defined in: errors.ts:31
Structured error representing an mNotify API failure.
Extends
Error
Constructors
Constructor
ts
new MNotifyError(
message,
statusCode,
data?,
context?,
cause?): MNotifyError;Defined in: errors.ts:32
Parameters
| Parameter | Type |
|---|---|
message | string |
statusCode | number |
data? | unknown |
context? | MNotifyErrorContext |
cause? | unknown |
Returns
MNotifyError
Overrides
ts
Error.constructorProperties
cause?
ts
readonly optional cause?: unknown;Defined in: errors.ts:37
Inherited from
ts
Error.causecontext?
ts
readonly optional context?: MNotifyErrorContext;Defined in: errors.ts:36
data?
ts
readonly optional data?: unknown;Defined in: errors.ts:35
statusCode
ts
readonly statusCode: number;Defined in: errors.ts:34
Methods
toJSON()
ts
toJSON(): Record<string, unknown>;Defined in: errors.ts:87
Returns
Record<string, unknown>
withContext()
ts
withContext(context): MNotifyError;Defined in: errors.ts:47
Returns a new MNotifyError with merged context.
Parameters
| Parameter | Type |
|---|---|
context | MNotifyErrorContext |
Returns
MNotifyError
fromUnknown()
ts
static fromUnknown(
error,
fallbackMessage,
statusCode,
context?,
data?): MNotifyError;Defined in: errors.ts:63
Creates an MNotifyError from an unknown value. Preserves the original error if it is already an MNotifyError.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
fallbackMessage | string |
statusCode | number |
context? | MNotifyErrorContext |
data? | unknown |
Returns
MNotifyError