Skip to main content

Class: NotFoundError<TCode, TValues>

Defined in: index.ts:140

A referenced resource is missing, or the caller may not access it. Use it for both so a response never reveals whether a resource the caller cannot see exists.

Extends​

Type Parameters​

Type ParameterDefault type
TCode extends string | undefinedstring | undefined
TValues extends ExpectedErrorValues | undefinedExpectedErrorValues | undefined

Constructors​

Constructor​

new NotFoundError<TCode, TValues>(message, options?): NotFoundError<TCode, TValues>

Defined in: index.ts:114

Parameters​

ParameterType
messagestring
optionsExpectedErrorOptions<TCode, TValues>

Returns​

NotFoundError<TCode, TValues>

Inherited from​

ExpectedError.constructor

Properties​

code​

readonly code: TCode

Defined in: index.ts:103

A subclass narrows it through the type parameter, e.g. extends ExpectedError<'CARD_DECLINED' | 'CARD_EXPIRED'>.

Inherited from​

ExpectedError.code


expected​

readonly expected: true

Defined in: index.ts:97

The discriminant isExpectedError reads. A marker rather than instanceof because a bundler may inline its own copy of this class, and an error thrown from that copy is not an instance of yours.

Inherited from​

ExpectedError.expected


messageRef?​

optional messageRef?: MessageRef

Defined in: index.ts:112

Mutable: a boundary may attach it before rendering.

Inherited from​

ExpectedError.messageRef


values​

readonly values: TValues

Defined in: index.ts:109

A subclass narrows it per code through the type parameter, so the placeholders its copy interpolates are a checked contract.

Inherited from​

ExpectedError.values