TransportError
Defined in: packages/agent/src/errors.ts:146
Extends
Section titled “Extends”ErrorKind
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TransportError(
code
):TransportError
Defined in: packages/agent/src/errors.ts:149
Parameters
Section titled “Parameters”ErrorCode
Returns
Section titled “Returns”TransportError
Overrides
Section titled “Overrides”ErrorKind.constructor
Properties
Section titled “Properties”
readonly
cause:object
Defined in: packages/agent/src/errors.ts:71
code:
ErrorCode
kind:
ErrorKindEnum
Inherited from
Section titled “Inherited from”ErrorKind.cause
message
Section titled “message”message:
string
Defined in: node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”ErrorKind.message
name:
string
='TransportError'
Defined in: packages/agent/src/errors.ts:147
Overrides
Section titled “Overrides”ErrorKind.name
stack?
Section titled “stack?”
optional
stack:string
Defined in: node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”ErrorKind.stack
stackTraceLimit
Section titled “stackTraceLimit”
static
stackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@20.19.1/node_modules/@types/node/globals.d.ts:149
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
Section titled “Inherited from”ErrorKind.stackTraceLimit
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get code():
ErrorCode
Defined in: packages/agent/src/errors.ts:73
Returns
Section titled “Returns”ErrorCode
Set Signature
Section titled “Set Signature”set code(
code
):void
Defined in: packages/agent/src/errors.ts:76
Parameters
Section titled “Parameters”ErrorCode
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ErrorKind.code
isCertified
Section titled “isCertified”Get Signature
Section titled “Get Signature”get isCertified():
boolean
Defined in: packages/agent/src/errors.ts:91
Reads the isCertified
property of the underlying error code.
Returns
Section titled “Returns”boolean
true
if the error is certified, false
otherwise.
Inherited from
Section titled “Inherited from”ErrorKind.isCertified
Get Signature
Section titled “Get Signature”get kind():
ErrorKindEnum
Defined in: packages/agent/src/errors.ts:80
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set kind(
kind
):void
Defined in: packages/agent/src/errors.ts:83
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ErrorKind.kind
Methods
Section titled “Methods”hasCode()
Section titled “hasCode()”hasCode<
C
>(code
):boolean
Defined in: packages/agent/src/errors.ts:101
Type Parameters
Section titled “Type Parameters”C
extends ErrorCode
Parameters
Section titled “Parameters”(…args
) => C
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”ErrorKind.hasCode
toString()
Section titled “toString()”toString():
string
Defined in: packages/agent/src/errors.ts:105
Returns a string representation of an object.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”ErrorKind.toString
captureStackTrace()
Section titled “captureStackTrace()”
static
captureStackTrace(targetObject
,constructorOpt?
):void
Defined in: node_modules/.pnpm/@types+node@20.19.1/node_modules/@types/node/globals.d.ts:133
Creates a .stack
property on targetObject
, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace()
was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`
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:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();
Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ErrorKind.captureStackTrace
fromCode()
Section titled “fromCode()”
static
fromCode<C
,E
>(this
,code
):E
Defined in: packages/agent/src/errors.ts:111
Type Parameters
Section titled “Type Parameters”C
extends ErrorCode
E
extends ErrorKind
Parameters
Section titled “Parameters”(code
) => E
C
Returns
Section titled “Returns”E
Inherited from
Section titled “Inherited from”ErrorKind.fromCode
prepareStackTrace()
Section titled “prepareStackTrace()”
static
prepareStackTrace(err
,stackTraces
):any
Defined in: node_modules/.pnpm/@types+node@20.19.1/node_modules/@types/node/globals.d.ts:137
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite
[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”ErrorKind.prepareStackTrace