@squidcloud/client
Version:
A typescript implementation of the Squid client
28 lines (27 loc) • 1.2 kB
TypeScript
/**
* A transactionId - alias for string
* @category Database
*/
export type TransactionId = string;
/**
* Represents an error thrown during an RPC (Remote Procedure Call) made by the Squid SDK.
*
* This error contains detailed HTTP-level information such as the status code, response body,
* headers, and the request URL, allowing for better debugging and error handling in client code.
*/
export declare class SquidClientError<BodyType = unknown> extends Error {
readonly statusCode: number;
readonly url?: string | undefined;
readonly headers?: Record<string, string> | undefined;
readonly body?: BodyType | undefined;
/**
* Creates a new `SquidClientError` instance.
*
* @param message - A custom error message.
* @param statusCode - The HTTP status code returned by the server (e.g., 400, 403, 422).
* @param url - The URL that was called when the error occurred.
* @param headers - The HTTP response headers.
* @param body - The parsed body of the error response.
*/
constructor(message: string, statusCode: number, url?: string | undefined, headers?: Record<string, string> | undefined, body?: BodyType | undefined);
}