Class: CancelError
Defined in: packages/core/src/error/CancelError.ts:7
Extension of GenericError which is used in route handling ot cancel currently managed route before proceeding with execution with new one.
Extends
GenericError
<{status
:409
; }>
Constructors
new CancelError()
new CancelError(
message
):CancelError
Defined in: packages/core/src/error/CancelError.ts:8
Parameters
message
string
= 'Canceled'
Returns
Overrides
Properties
_params
protected
_params:object
&GenericErrorParams
Defined in: packages/core/src/error/GenericError.ts:16
Type declaration
status
status:
409
Inherited from
cause?
optional
cause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
message
message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional
stack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
prepareStackTrace()?
static
optional
prepareStackTrace: (err
,stackTraces
) =>any
Defined in: node_modules/@types/node/globals.d.ts:98
Optional override for formatting stack traces
Parameters
err
Error
stackTraces
CallSite
[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
GenericError
.prepareStackTrace
stackTraceLimit
static
stackTraceLimit:number
Defined in: node_modules/@types/node/globals.d.ts:100
Inherited from
Methods
getHttpStatus()
getHttpStatus():
number
Defined in: packages/core/src/error/GenericError.ts:39
Returns the HTTP status to send to the client.
If the error has occurred at the client-side, the status code is used to determine the error page to show to the user.
This method is a shorthand for the following code snippet:
this.getParams().status || 500
.
Returns
number
The HTTP status to send to the client.
See
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Inherited from
getParams()
getParams():
object
&GenericErrorParams
Defined in: packages/core/src/error/GenericError.ts:46
Returns the error parameters providing additional details about the
error. The structure of the returned object is always
situation-dependent, but the returned object usually contains the
status: number
field which represents the HTTP status to send to
the client.
Returns
object
& GenericErrorParams
The route parameters of the route at which the error has occurred.
See
Error#getHttpStatus
Inherited from
isClientError()
isClientError():
boolean
Defined in: packages/core/src/error/GenericError.ts:53
Tests, whether the specified error was caused by the client's action (for example wrong URL or request encoding).
Returns
boolean
true
if the error was caused the action of the
client.
Inherited from
isRedirection()
isRedirection():
boolean
Defined in: packages/core/src/error/GenericError.ts:60
Tests, whether the specified error should lead to a redirect.
Returns
boolean
true
if the error should cause a redirect.
Inherited from
captureStackTrace()
static
captureStackTrace(targetObject
,constructorOpt
?):void
Defined in: node_modules/@types/node/globals.d.ts:91
Create .stack property on a target object
Parameters
targetObject
object
constructorOpt?
Function
Returns
void