MCPcopy Index your code
hub / github.com/hunvreus/pagescms / createHttpError

Function createHttpError

lib/api-error.ts:8–13  ·  view source on GitHub ↗
(message: string, status: number, headers?: HeadersInit)

Source from the content-addressed store, hash-verified

6};
7
8const createHttpError = (message: string, status: number, headers?: HeadersInit) => {
9 const error = new Error(message) as Error & { status: number; headers?: HeadersInit };
10 error.status = status;
11 error.headers = headers;
12 return error;
13};
14
15const getErrorMessage = (error: unknown): string => {
16 if (error instanceof Error && error.message) return error.message;

Callers 15

requireAdminSessionFunction · 0.90
getRepoReadContextFunction · 0.90
token.tsFile · 0.90
createOctokitInstanceFunction · 0.90
GETFunction · 0.90
GETFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected