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
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()
Returns
error
error.code
error.message
captureStackTrace()
.stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
${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()
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