Skip to main content

Class: CallError

Thrown when a call or a value can't be decoded, resolved, allowed, run or encoded (extends MobxKeystoneError). Errors thrown by the action or view being called are not CallErrors: they are rethrown as they are.

Use instanceof CallError to distinguish call errors from other MobxKeystoneError instances.

Extends​

Constructors​

Constructor​

new CallError(data): CallError;

Parameters​

ParameterType
dataCallErrorData

Returns​

CallError

Overrides​

MobxKeystoneError.constructor

Properties​

cause?​

readonly optional cause?: unknown;

The error that caused it, if any.

Overrides​

MobxKeystoneError.cause


code​

readonly code: CallErrorCode;

The reason.


message​

message: string;

Inherited from​

MobxKeystoneError.message


name​

name: string;

Inherited from​

MobxKeystoneError.name


path​

readonly path: Path;

Where in the call or value the error is, e.g. ["args", 1].


stack?​

optional stack?: string;

Inherited from​

MobxKeystoneError.stack

Methods​

toJSON()​

toJSON(): CallErrorJson;

The error as JSON, for RPC and tool layers. It leaves out the cause's message, and the value preview of a CannotEncode error, since they may hold the server's data.

Returns​

CallErrorJson


isError()​

static isError(error): error is Error;

Indicates whether the argument provided is a built-in Error instance or not.

Parameters​

ParameterType
errorunknown

Returns​

error is Error

Inherited from​

MobxKeystoneError.isError