MCPcopy Create free account
hub / github.com/observablehq/framework / isApiError

Function isApiError

src/error.ts:36–45  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

34}
35
36export function isApiError(error: unknown): error is HttpError & {details: {errors: {code: string}[]}} {
37 return (
38 isHttpError(error) &&
39 !!error.details &&
40 typeof error.details === "object" &&
41 "errors" in error.details &&
42 Array.isArray(error.details.errors) &&
43 error.details.errors.every((e) => typeof e === "object" && "code" in e)
44 );
45}
46
47/** Throw this to indicate the CLI should exit with a non-zero exit code. */
48export class CliError extends Error {

Callers 2

getDeployTargetMethod · 0.85
_fetchMethod · 0.85

Calls 1

isHttpErrorFunction · 0.85

Tested by

no test coverage detected