export declare class LDUnexpectedResponseError extends Error { constructor(message: string); } export declare class LDClientError extends Error { constructor(message: string); } export declare class LDTimeoutError extends Error { constructor(message: string); } /** * How a failure is classified, which decides how long the next wait is. * * A 'normal' failure is one the service is expected to recover from without * intervention, so the wait stays short. An 'unexpected' failure suggests a * problem that requires a person to fix, such as a rejected credential, so the * wait becomes much longer. Neither classification ever means giving up; there * is always a next attempt. */ export type FailureKind = 'normal' | 'unexpected'; /** * Classifies an HTTP status. * * 400, 408, and 429 are normal, as is any 5xx. Every other 4xx, including 401 * and 403, is unexpected. Anything outside the error ranges, including 0 for * "no response", is normal. */ export declare function classifyHttpStatus(status: number): FailureKind; /** * Classifies a transport-level failure (connection refused or dropped, DNS * failure, timeout, TLS negotiation failure). * * Always normal: in an all-HTTPS system every transport error surfaces through * the TLS layer, so a certificate misconfiguration cannot be reliably * distinguished from a transient network fault, and treating transient faults * as unexpected would hold ordinary recoveries to multi-minute waits. */ export declare function classifyTransportFailure(): FailureKind; /** * Check if the HTTP error is recoverable. This will return false if a request * made with any payload could not recover. If the reason for the failure * is payload specific, for instance a payload that is too large, then * it could recover with a different payload. * * Superseded by {@link classifyHttpStatus}, which this delegates to. It is * retained for the event-delivery pathway and is expected to be deprecated * once that pathway migrates to failure classification. */ export declare function isHttpRecoverable(status: number): boolean; /** * Returns true if the status could recover for a different payload. * * When used with event processing this indicates that we should discard * the payload, but that a subsequent payload may succeed. Therefore we should * not stop event processing. */ export declare function isHttpLocallyRecoverable(status: number): boolean; //# sourceMappingURL=errors.d.ts.map