ParseError
Defined in: src/errors/ZeroTransferError.ts:236
Error raised when protocol text or metadata cannot be parsed safely.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ParseError(details: SpecializedErrorDetails): ParseError;Defined in: src/errors/ZeroTransferError.ts:242
Creates a parser failure.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
details | SpecializedErrorDetails | Error context with malformed input details. |
Returns
Section titled “Returns”ParseError
Overrides
Section titled “Overrides”Properties
Section titled “Properties”| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | ZeroTransferError.cause | website/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
code | readonly | string | Stable machine-readable error code. | ZeroTransferError.code | src/errors/ZeroTransferError.ts:53 |
command? | readonly | string | Protocol command associated with the failure, if any. | ZeroTransferError.command | src/errors/ZeroTransferError.ts:59 |
details? | readonly | Record<string, unknown> | Additional structured details for diagnostics. | ZeroTransferError.details | src/errors/ZeroTransferError.ts:69 |
ftpCode? | readonly | number | FTP response code associated with the failure. | ZeroTransferError.ftpCode | src/errors/ZeroTransferError.ts:61 |
host? | readonly | string | Remote host associated with the failing operation. | ZeroTransferError.host | src/errors/ZeroTransferError.ts:57 |
message | public | string | - | ZeroTransferError.message | website/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ZeroTransferError.name | website/node_modules/typescript/lib/lib.es5.d.ts:1074 |
path? | readonly | string | Remote path associated with the failure. | ZeroTransferError.path | src/errors/ZeroTransferError.ts:65 |
protocol? | readonly | "ftp" | "ftps" | "sftp" | Protocol active when the error occurred. | ZeroTransferError.protocol | src/errors/ZeroTransferError.ts:55 |
retryable | readonly | boolean | Whether retry policy may safely retry this failure. | ZeroTransferError.retryable | src/errors/ZeroTransferError.ts:67 |
sftpCode? | readonly | number | SFTP status code associated with the failure. | ZeroTransferError.sftpCode | src/errors/ZeroTransferError.ts:63 |
stack? | public | string | - | ZeroTransferError.stack | website/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | 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. | ZeroTransferError.stackTraceLimit | node_modules/@types/node/globals.d.ts:67 |
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Defined in: node_modules/@types/node/globals.d.ts:51
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”| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ZeroTransferError.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”ZeroTransferError.prepareStackTrace
toJSON()
Section titled “toJSON()”toJSON(): Record<string, unknown>;Defined in: src/errors/ZeroTransferError.ts:96
Serializes the error into a plain object suitable for logs or API responses.
Returns
Section titled “Returns”Record<string, unknown>
A JSON-safe object containing public structured error fields.