/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { ITelemetryBaseProperties } from "@fluidframework/core-interfaces"; import { type DriverErrorTelemetryProps } from "@fluidframework/driver-utils/internal"; import { type IOdspErrorAugmentations, type OdspError } from "@fluidframework/odsp-driver-definitions/internal"; import { type IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils/internal"; /** * @internal */ export declare const fetchIncorrectResponse = 712; /** * @internal */ export declare const OdspServiceReadOnlyErrorCode = "serviceReadOnly"; /** * @internal */ export declare function getSPOAndGraphRequestIdsFromResponse(headers: { get: (id: string) => string | undefined | null; }): ITelemetryBaseProperties; /** * Empirically-based model of error response inner error from ODSP * * @internal */ export interface OdspErrorResponseInnerError { code?: string; innerError?: OdspErrorResponseInnerError; } /** * Empirically-based model of error responses from ODSP * * @internal */ export interface OdspErrorResponse { error: OdspErrorResponseInnerError & { message: string; }; } /** * Error encapsulating the error response from ODSP containing the redirect location when a resource has moved * * @internal */ export declare class OdspRedirectError extends LoggingError implements IFluidErrorBase { readonly redirectLocation: string | undefined; readonly errorType: "fileNotFoundOrAccessDeniedError"; readonly canRetry = false; constructor(message: string, redirectLocation: string | undefined, props: DriverErrorTelemetryProps); } /** * @internal */ export declare function tryParseErrorResponse(response: string | undefined): { success: true; errorResponse: OdspErrorResponse; } | { success: false; }; /** * @internal */ export declare function parseFacetCodes(errorResponse: OdspErrorResponse): string[]; /** * @internal */ export declare function createOdspNetworkError(errorMessage: string, statusCode: number, retryAfterSeconds?: number, response?: Response, responseText?: string, props?: ITelemetryBaseProperties): IFluidErrorBase & OdspError; /** * @internal */ export declare function enrichOdspError(error: IFluidErrorBase & OdspError, response?: Response, facetCodes?: string[], props?: ITelemetryBaseProperties): IFluidErrorBase & OdspError; /** * Throws network error - an object with a bunch of network related properties * @internal */ export declare function throwOdspNetworkError(errorMessage: string, statusCode: number, response: Response, responseText?: string, props?: ITelemetryBaseProperties): never; /** * @internal */ export declare function hasFacetCodes(x: unknown): x is Pick; /** * @internal */ export declare function hasRedirectionLocation(x: unknown): x is Pick; //# sourceMappingURL=odspErrorUtils.d.ts.map