// This file was auto-generated by Fern from our API Definition. import type * as core from "../core/index.js"; import * as errors from "./index.js"; export function handleNonStatusCodeError( error: core.Fetcher.Error, rawResponse: core.RawResponse, method: string, path: string, ): never { switch (error.reason) { case "non-json": throw new errors.IntercomError({ statusCode: error.statusCode, body: error.rawBody, rawResponse: rawResponse, }); case "body-is-null": throw new errors.IntercomError({ statusCode: error.statusCode, rawResponse: rawResponse, }); case "timeout": throw new errors.IntercomTimeoutError(`Timeout exceeded when calling ${method} ${path}.`); case "unknown": throw new errors.IntercomError({ message: error.errorMessage, rawResponse: rawResponse, }); default: throw new errors.IntercomError({ message: "Unknown error", rawResponse: rawResponse, }); } }