Skip to content

Class: SwarmError

Base class for all Swarm errors.

Extends

  • Error

Extended by

Constructors

Constructor

ts
new SwarmError(message: string, options?: SwarmErrorOptions): SwarmError;

Creates a new SwarmError instance.

Parameters

ParameterTypeDescription
messagestringThe error message.
options?SwarmErrorOptionsThe error options.

Returns

SwarmError

Overrides

ts
Error.constructor;

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
stack?publicstring-Error.stack
prepareStackTrace?static(err: Error, stackTraces: CallSite[]) => anyOptional override for formatting stack traces See https://v8.dev/docs/stack-trace-api#customizing-stack-tracesError.prepareStackTrace
stackTraceLimitstaticnumber-Error.stackTraceLimit

Accessors

[toStringTag]

Get Signature

ts
get toStringTag: string;
Returns

string


message

Get Signature

ts
get message(): string;
Returns

string

Overrides

ts
Error.message;

name

Get Signature

ts
get name(): string;
Returns

string

Overrides

ts
Error.name;

Methods

[toPrimitive]()

ts
toPrimitive: string | true;

Parameters

ParameterType
hint"string" | "number" | "default"

Returns

string | true


toString()

ts
toString(): string;

Returns a string representation of an object.

Returns

string


[hasInstance]()

ts
static hasInstance: boolean;

Parameters

ParameterType
instanceunknown

Returns

boolean


captureStackTrace()

ts
static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Create .stack property on a target object

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

ts
Error.captureStackTrace;