Errors
AccountRequiresMemoError
AccountRequiresMemoError is raised when a transaction is trying to submit an operation to an account which requires a memo. See SEP0029 for more information.
This error contains two attributes to help you identify the account requiring the memo and the operation where the account is the destination
class AccountRequiresMemoError extends Error { constructor(message: string, accountId: string, operationIndex: number); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; accountId: string; cause?: unknown; message: string; name: string; operationIndex: number; stack?: string;}Example
console.log('The following account requires a memo ', err.accountId)console.log('The account is used in operation: ', err.operationIndex)Source: src/errors/account_requires_memo.ts:20
new AccountRequiresMemoError(message, accountId, operationIndex)
constructor(message: string, accountId: string, operationIndex: number);Parameters
message—string(required)accountId—string(required)operationIndex—number(required)
Source: src/errors/account_requires_memo.ts:24
AccountRequiresMemoError.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.
static stackTraceLimit: number;Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68
AccountRequiresMemoError.captureStackTrace(targetObject, constructorOpt)
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();static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Parameters
targetObject—object(required)constructorOpt—Function(optional)
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52
AccountRequiresMemoError.prepareStackTrace(err, stackTraces)
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Parameters
err—Error(required)stackTraces—CallSite[](required)
See also
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56
accountRequiresMemoError.accountId
accountId: string;Source: src/errors/account_requires_memo.ts:21
accountRequiresMemoError.cause
cause?: unknown;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
accountRequiresMemoError.message
message: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
accountRequiresMemoError.name
name: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
accountRequiresMemoError.operationIndex
operationIndex: number;Source: src/errors/account_requires_memo.ts:22
accountRequiresMemoError.stack
stack?: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
BadRequestError
BadRequestError is raised when a request made to Horizon is invalid in some way (incorrect timebounds for trade call builders, for example.)
class BadRequestError extends NetworkError { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };}Source: src/errors/bad_request.ts:10
new BadRequestError(message, response)
constructor(message: string, response: any);Parameters
message—string(required)response—any(required)
Source: src/errors/network.ts:29
BadRequestError.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.
static stackTraceLimit: number;Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68
BadRequestError.captureStackTrace(targetObject, constructorOpt)
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();static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Parameters
targetObject—object(required)constructorOpt—Function(optional)
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52
BadRequestError.prepareStackTrace(err, stackTraces)
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Parameters
err—Error(required)stackTraces—CallSite[](required)
See also
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56
badRequestError.cause
cause?: unknown;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
badRequestError.message
message: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
badRequestError.name
name: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
badRequestError.response
Response details, received from the Horizon server.
response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Source: src/errors/network.ts:18
badRequestError.stack
stack?: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
badRequestError.getResponse()
Returns the error response sent by the Horizon server.
getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Returns
Response details, received from the Horizon server.
Source: src/errors/network.ts:38
BadResponseError
BadResponseError is raised when a response from a
Horizon or Federation
server is invalid in some way. For example, a federation response may exceed
the maximum allowed size, or a transaction submission may have failed with
Horizon.
class BadResponseError extends NetworkError { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };}Source: src/errors/bad_response.ts:13
new BadResponseError(message, response)
constructor(message: string, response: any);Parameters
message—string(required)response—any(required)
Source: src/errors/network.ts:29
BadResponseError.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.
static stackTraceLimit: number;Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68
BadResponseError.captureStackTrace(targetObject, constructorOpt)
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();static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Parameters
targetObject—object(required)constructorOpt—Function(optional)
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52
BadResponseError.prepareStackTrace(err, stackTraces)
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Parameters
err—Error(required)stackTraces—CallSite[](required)
See also
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56
badResponseError.cause
cause?: unknown;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
badResponseError.message
message: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
badResponseError.name
name: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
badResponseError.response
Response details, received from the Horizon server.
response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Source: src/errors/network.ts:18
badResponseError.stack
stack?: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
badResponseError.getResponse()
Returns the error response sent by the Horizon server.
getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Returns
Response details, received from the Horizon server.
Source: src/errors/network.ts:38
NetworkError
NetworkError is raised when an interaction with a Horizon server has caused some kind of problem.
class NetworkError extends Error { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };}Source: src/errors/network.ts:16
new NetworkError(message, response)
constructor(message: string, response: any);Parameters
message—string(required)response—any(required)
Source: src/errors/network.ts:29
NetworkError.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.
static stackTraceLimit: number;Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68
NetworkError.captureStackTrace(targetObject, constructorOpt)
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();static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Parameters
targetObject—object(required)constructorOpt—Function(optional)
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52
NetworkError.prepareStackTrace(err, stackTraces)
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Parameters
err—Error(required)stackTraces—CallSite[](required)
See also
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56
networkError.cause
cause?: unknown;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
networkError.message
message: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
networkError.name
name: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
networkError.response
Response details, received from the Horizon server.
response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Source: src/errors/network.ts:18
networkError.stack
stack?: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
networkError.getResponse()
Returns the error response sent by the Horizon server.
getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Returns
Response details, received from the Horizon server.
Source: src/errors/network.ts:38
NotFoundError
NotFoundError is raised when the resource requested from Horizon is unavailable.
class NotFoundError extends NetworkError { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };}Source: src/errors/not_found.ts:10
new NotFoundError(message, response)
constructor(message: string, response: any);Parameters
message—string(required)response—any(required)
Source: src/errors/network.ts:29
NotFoundError.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.
static stackTraceLimit: number;Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68
NotFoundError.captureStackTrace(targetObject, constructorOpt)
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();static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Parameters
targetObject—object(required)constructorOpt—Function(optional)
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52
NotFoundError.prepareStackTrace(err, stackTraces)
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Parameters
err—Error(required)stackTraces—CallSite[](required)
See also
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56
notFoundError.cause
cause?: unknown;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
notFoundError.message
message: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
notFoundError.name
name: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
notFoundError.response
Response details, received from the Horizon server.
response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Source: src/errors/network.ts:18
notFoundError.stack
stack?: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
notFoundError.getResponse()
Returns the error response sent by the Horizon server.
getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string };Returns
Response details, received from the Horizon server.
Source: src/errors/network.ts:38
WebAuth.InvalidChallengeError
InvalidChallengeError is raised when a challenge transaction does not meet the requirements for a SEP-10 challenge transaction (for example, a non-zero sequence number).
class InvalidChallengeError extends Error { constructor(message?: string); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; stack?: string;}Source: src/webauth/errors.ts:8
new InvalidChallengeError(message)
constructor(message?: string);Parameters
message—string(optional)
Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1082
InvalidChallengeError.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.
static stackTraceLimit: number;Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68
InvalidChallengeError.captureStackTrace(targetObject, constructorOpt)
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();static captureStackTrace(targetObject: object, constructorOpt?: Function): void;Parameters
targetObject—object(required)constructorOpt—Function(optional)
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52
InvalidChallengeError.prepareStackTrace(err, stackTraces)
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;Parameters
err—Error(required)stackTraces—CallSite[](required)
See also
Source: node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56
invalidChallengeError.cause
cause?: unknown;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
invalidChallengeError.message
message: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
invalidChallengeError.name
name: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
invalidChallengeError.stack
stack?: string;Source: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078