Skip to main content
The error a vendor server throws to answer a Tappify call with a code and a message the owner sees.

Remarks

createTappifyHandler catches it and answers { error: { code, message } } with status, or 400 when no status was given; the host relays both to the calling mount, where they arrive as the error of useTapServer. Pick a code of your own and keep it stable — the SDK’s own codes are SERVER_ERROR_CODES — and write the message for the owner, who reads it on screen.

Example

Extends

  • Error

Constructors

Constructor

Parameters

code
string
message
string
status?
number

Returns

TapServerError

Overrides

Properties

code


message

Inherited from


name

Inherited from


stack?

Inherited from


status


stackTraceLimit

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

Methods

toJSON()

The wire body the handler answers with, without the status.

Returns

error
error.code
error.message

captureStackTrace()

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

Parameters

targetObject
object
constructorOpt?
Function

Returns

void

Inherited from


is()

Narrows an unknown value to a TapServerError by name and by carrying a string code, so it holds across module instances.

Parameters

value
unknown

Returns

value is TapServerError

prepareStackTrace()

Parameters

err
Error
stackTraces
CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from