MCPcopy Create free account
hub / github.com/cloudflare/serverless-registry / constructor

Method constructor

src/errors.ts:4–22  ·  view source on GitHub ↗
(r: Request)

Source from the content-addressed store, hash-verified

2
3export class AuthErrorResponse extends Response {
4 constructor(r: Request) {
5 const jsonBody = JSON.stringify({
6 errors: [
7 {
8 code: "UNAUTHORIZED",
9 message: "authentication required",
10 detail: null,
11 },
12 ],
13 });
14 const init = {
15 status: 401,
16 headers: {
17 "content-type": "application/json;charset=UTF-8",
18 "WWW-Authenticate": `Basic realm="${r.url}"`,
19 },
20 };
21 super(jsonBody, init);
22 }
23}
24
25export class RangeError extends Response {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected