/** * Represents an error that is thrown when an invalid subject is encountered. * This class extends the built-in Error object. * * @class * @extends Error */ export declare class InvalidSubjectError extends Error { constructor(subject: string, options?: ErrorOptions); } export declare class InvalidArgumentError extends Error { constructor(message: string, options?: ErrorOptions); static format(property: string | string[], message: string, options?: ErrorOptions): InvalidArgumentError; } /** * InvalidOperationError is a custom error class that extends the standard Error object. * It represents an error that occurs when an invalid operation is attempted on one of * objects returned by the API. For example, trying to iterate on an object that was * configured with a callback. * * @class InvalidOperationError * @extends {Error} * * @param {string} message - The error message that explains the reason for the error. * @param {ErrorOptions} [options] - Optional parameter to provide additional error options. */ export declare class InvalidOperationError extends Error { constructor(message: string, options?: ErrorOptions); } /** * Represents an error indicating that user authentication has expired. * This error is typically thrown when a user attempts to access a connection * but their authentication credentials have expired. */ export declare class UserAuthenticationExpiredError extends Error { constructor(message: string, options?: ErrorOptions); static parse(s: string): UserAuthenticationExpiredError | null; } /** * Represents an error related to authorization issues. * Note that these could represent an authorization violation, * or that the account authentication configuration has expired, * or an authentication timeout. */ export declare class AuthorizationError extends Error { constructor(message: string, options?: ErrorOptions); static parse(s: string): AuthorizationError | null; } /** * Class representing an error thrown when an operation is attempted on a closed connection. * * This error is intended to signal that a connection-related operation could not be completed * because the connection is no longer open or has been terminated. * * @class * @extends Error */ export declare class ClosedConnectionError extends Error { constructor(); } /** * The `ConnectionDrainingError` class represents a specific type of error * that occurs when a connection is being drained. * * This error is typically used in scenarios where connections need to be * gracefully closed or when they are transitioning to an inactive state. * * The error message is set to "connection draining" and the error name is * overridden to "DrainingConnectionError". */ export declare class DrainingConnectionError extends Error { constructor(); } /** * Represents an error that occurs when a network connection fails. * Extends the built-in Error class to provide additional context for connection-related issues. * * @param {string} message - A human-readable description of the error. * @param {ErrorOptions} [options] - Optional settings for customizing the error behavior. */ export declare class ConnectionError extends Error { constructor(message: string, options?: ErrorOptions); } /** * Represents an error encountered during protocol operations. * This class extends the built-in `Error` class, providing a specific * error type called `ProtocolError`. * * @param {string} message - A descriptive message describing the error. * @param {ErrorOptions} [options] - Optional parameters to include additional details. */ export declare class ProtocolError extends Error { constructor(message: string, options?: ErrorOptions); } /** * Class representing an error that occurs during an request operation * (such as TimeoutError, or NoRespondersError, or some other error). * * @extends Error */ export declare class RequestError extends Error { constructor(message?: string, options?: ErrorOptions); isNoResponders(): boolean; } /** * TimeoutError is a custom error class that extends the built-in Error class. * It is used to represent an error that occurs when an operation exceeds a * predefined time limit. * * @class * @extends {Error} */ export declare class TimeoutError extends Error { constructor(options?: ErrorOptions); } /** * NoRespondersError is an error thrown when no responders (no service is * subscribing to the subject) are found for a given subject. This error * is typically found as the cause for a RequestError * * @extends Error * * @param {string} subject - The subject for which no responders were found. * @param {ErrorOptions} [options] - Optional error options. */ export declare class NoRespondersError extends Error { subject: string; constructor(subject: string, options?: ErrorOptions); } /** * Class representing a Permission Violation Error. * It provides information about the operation (either "publish" or "subscription") * and the subject used for the operation and the optional queue (if a subscription). * * This error is terminal for a subscription. */ export declare class PermissionViolationError extends Error { operation: "publish" | "subscription"; subject: string; queue?: string; constructor(message: string, operation: "publish" | "subscription", subject: string, queue?: string, options?: ErrorOptions); static parse(s: string): PermissionViolationError | null; } export declare const errors: { AuthorizationError: typeof AuthorizationError; ClosedConnectionError: typeof ClosedConnectionError; ConnectionError: typeof ConnectionError; DrainingConnectionError: typeof DrainingConnectionError; InvalidArgumentError: typeof InvalidArgumentError; InvalidOperationError: typeof InvalidOperationError; InvalidSubjectError: typeof InvalidSubjectError; NoRespondersError: typeof NoRespondersError; PermissionViolationError: typeof PermissionViolationError; ProtocolError: typeof ProtocolError; RequestError: typeof RequestError; TimeoutError: typeof TimeoutError; UserAuthenticationExpiredError: typeof UserAuthenticationExpiredError; };