import type { HttpRequestOptions } from '../requests/polarity-request'; /** * @deprecated Do not use in v2 integrations. * @public */ export interface ResponseError { name: string; message: string; stack?: string; code?: number | string; } /** * @public */ export type ErrorMeta = { [otherMetadata: string]: unknown; }; /** * @public */ export type MetaObject = { [key: string]: unknown; }; /** * @public */ export interface IntegrationErrorProperties { /** * a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of * the problem except for purposes of localization. If omitted, the title will default to the type * of error (e.g., IntegrationError, or ApiRequestError) */ title?: string; /** * Additional details related to the error that may help the user troubleshoot the issue. If set by the user * via the Error constructor, the user provided value will override any automated help message set by the * Error class. */ help?: string; /** * The `cause` property is used to specify the `cause` of the error. Typically, * this property is used to pass through a related Error instance but can be any value. */ cause?: unknown; /** * The HTTP status code applicable to this error, expressed as a string value. */ status?: string; /** * an application-specific error code, expressed as a string value. */ code?: string; /** * Relevant for integration errors involving a network call, the `requestOptions` property * details the request options that resulted in the specified error. The `requestOptions` property will automatically * have sensitive authentication headers stripped. * By default, the following paths are sanitized: * * - auth.password * - auth.bearer * - body.password * - form.client_secret * - headers.authorization * - headers.x-api-key * * Additional paths can be sanitized by using the `requestOptionsToSanitize` property. */ requestOptions?: HttpRequestOptions; /** * List of paths in JSON dot notation to sanitize in the requestOptions object */ requestOptionsToSanitize?: string[]; /** * Any additional properties which will be appended to the Error's meta property */ meta?: MetaObject; } /** * @public */ export interface SerializedIntegrationError { /** * a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of * the problem except for purposes of localization. If omitted, the title will default to the type * of error (e.g., IntegrationError, or ApiRequestError) */ title: string; /** * The name data property of IntegrationError.prototype is shared by all Error instances. * It represents the name for the type of error. For IntegrationError.prototype.name, * the initial value is "IntegrationError". */ name: string; /** * a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be * localized */ detail: string; /** * An optional HTTP status code applicable to this error, expressed as a string value. */ status?: string; /** * Additional details related to the error that may help the user troubleshoot the issue. If set by the user * via the Error constructor, the user provided value will override any automated help message set by the * Error class. */ help?: string; /** * An optional StackTrace of the error */ stack?: string; /** * An optional application-specific error code, expressed as a string value. */ code?: number | string; /** * The `cause` property is used to specify the `cause` of the error. Typically, * this property is used to pass through a related Error instance but can be any value. */ cause?: unknown; /** * Relevant for integration errors involving a network call, the `requestOptions` property * details the request options that resulted in the specified error. The `requestOptions` property will automatically * have sensitive authentication headers stripped. */ requestOptions?: HttpRequestOptions; /** * an optional meta object containing non-standard meta-information about the error. */ meta?: ErrorMeta; } /** * @public */ export declare class IntegrationError extends Error { /** * a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of * the problem except for purposes of localization. */ readonly title: string; /** * a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be * localized */ readonly detail: string; /** * a meta object containing non-standard meta-information about the error. */ readonly meta?: ErrorMeta; /** * The HTTP status code applicable to this error, expressed as a string value. */ readonly status?: string; /** * an application-specific error code, expressed as a string value. */ readonly code?: string; /** * The `cause` property is used to specify the `cause` of the error. Typically, * this property is used to pass through a related Error instance but can be any value. */ readonly cause?: unknown; /** * Additional details related to the error that may help the user troubleshoot the issue. If set by the user * via the Error constructor, the user provided value will override any automated help message set by the * Error class. */ readonly help?: string; /** * Relevant for integration errors involving a network call, the `requestOptions` property * details the request options that resulted in the specified error. The `requestOptions` property will automatically * have sensitive authentication headers stripped. */ readonly requestOptions?: HttpRequestOptions; /** * Construct a new IntegrationError object. * @param message - A string description of the error which is used as the `detail` property on the * serialized error. * @param properties - Optional properties for the error. */ constructor(message: string, properties?: IntegrationErrorProperties); /** * Serializes the error's properties into a POJO. The order of the * properties is preserved when serialized. * @returns JSON representation of the error */ toJSON(): SerializedIntegrationError; } //# sourceMappingURL=integration-error.d.ts.map