Skip to content

Taxum / @taxum/core / extract / MalformedJsonError

Class: MalformedJsonError

Defined in: extract/json.ts:18

ClientError represents any error thrown due to issues with client requests.

This error is generally used by built-in extractors and middleware. You can check for this error in your own error handler to create responses matching your own API error format.

ClientError is not extending Error on purpose, but instead only implements it. This allows us to avoid the performance penality of stack traces on errors which are used for control flow.

Extends

Constructors

Constructor

new MalformedJsonError(reason): MalformedJsonError

Defined in: extract/json.ts:19

Parameters

reason

string

Returns

MalformedJsonError

Overrides

ClientError.constructor

Properties

message

readonly message: string

Defined in: util/client-error.ts:21

Inherited from

ClientError.message


status

readonly status: StatusCode

Defined in: util/client-error.ts:20

Inherited from

ClientError.status

Accessors

name

Get Signature

get name(): string

Defined in: util/client-error.ts:28

Returns

string

Inherited from

ClientError.name

Methods

[TO_HTTP_RESPONSE]()

[TO_HTTP_RESPONSE](): HttpResponse

Defined in: util/client-error.ts:32

Returns

HttpResponse

Inherited from

ClientError.[TO_HTTP_RESPONSE]