MCPcopy Index your code
hub / github.com/code-with-antonio/nightcode / getErrorMessage

Function getErrorMessage

packages/cli/src/lib/http-errors.ts:7–18  ·  view source on GitHub ↗
(response: ErrorResponse)

Source from the content-addressed store, hash-verified

5};
6
7export async function getErrorMessage(response: ErrorResponse) {
8 try {
9 const data = (await response.json()) as { error?: string };
10 if (typeof data.error === "string" && data.error.length > 0) {
11 return data.error;
12 }
13 } catch {
14 // Ignore invalid error payloads and fall back to the status text below.
15 }
16
17 return response.statusText || `Request failed with status ${response.status}`;
18};

Callers 5

fetchSessionsFunction · 0.90
openUpgradeCheckoutFunction · 0.90
openBillingPortalFunction · 0.90
fetchSessionFunction · 0.90
createSessionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected