KeyworkResourceError
Overview
Usage
- Node
- Deno
- Browser/ESM
import { KeyworkResourceError } from 'keywork/errors'
import { KeyworkResourceError } from 'https://deno.land/x/keywork/errors'
let { KeyworkResourceError } = await import('https://esm.sh/keywork/errors')
Hierarchy
Error
↳
KeyworkResourceError
Constructors
constructor
new KeyworkResourceError
(statusText?, status?)
Parameters in the format of an HTTP status error.
Parameters
Name | Type | Description |
---|---|---|
statusText? | string | Default Value STATUS_TEXT[Status.InternalServerError] See Re-exported from https://deno.land/[email protected]/http/http_status.ts |
status? | Status | Default Value Status.InternalServerError See Re-exported from https://deno.land/[email protected]/http/http_status.ts |
Overrides
Error.constructor
Defined in
errors/KeyworkResourceError.ts:57
new KeyworkResourceError
(errorLike)
Deprecated
TypeScript has inferred that errorLike
is already an instance of KeyworkResourceError
Parameters
Name | Type |
---|---|
errorLike | KeyworkResourceError |
Overrides
Error.constructor
Defined in
errors/KeyworkResourceError.ts:74
new KeyworkResourceError
(errorLike, status?)
Converting an unknown error object into a well-formed KeyworkResourceError
Parameters
Name | Type | Description |
---|---|---|
errorLike | unknown | |
status? | Status | Default Value Status.InternalServerError See Re-exported from https://deno.land/[email protected]/http/http_status.ts |
Overrides
Error.constructor
Defined in
errors/KeyworkResourceError.ts:78
Properties
status
status: [`Status`](../enums/Status.mdx)
The HTTP Status Code associated with the error.
Defined in
errors/KeyworkResourceError.ts:52
statusText
statusText: `string`
The reason for the error.
Defined in
errors/KeyworkResourceError.ts:48
Accessors
message
get
message
(): `string`
Returns
string
Overrides
Error.message
Defined in
errors/KeyworkResourceError.ts:109
Methods
toJSON
toJSON
(): [`ErrorJSONBody`](../interfaces/ErrorJSONBody.mdx)
Returns
Defined in
errors/KeyworkResourceError.ts:113
assertIsConstructorOf
Static
assertIsConstructorOf
(ErrorCtor): ErrorCtor is typeof KeyworkResourceError
Parameters
Name | Type |
---|---|
ErrorCtor | unknown |
Returns
ErrorCtor is typeof KeyworkResourceError
Defined in
errors/KeyworkResourceError.ts:133
assertIsInstanceOf
Static
assertIsInstanceOf
(errorLike): errorLike is KeyworkResourceError
Parameters
Name | Type |
---|---|
errorLike | Error |
Returns
errorLike is KeyworkResourceError
Defined in
errors/KeyworkResourceError.ts:127
An error class that feels fits nicely into an incoming HTTP request handler.