MCPcopy Index your code
hub / github.com/GitbookIO/gitbook / serveErrorResponse

Function serveErrorResponse

packages/gitbook/src/middleware.ts:440–449  ·  view source on GitHub ↗

* Serve an error response.

(error: Error)

Source from the content-addressed store, hash-verified

438 * Serve an error response.
439 */
440function serveErrorResponse(error: Error) {
441 if (error instanceof DataFetcherError) {
442 return new Response(error.message, {
443 status: error.code,
444 headers: { 'content-type': 'text/plain' },
445 });
446 }
447
448 throw error;
449}
450
451/**
452 * Server a response with an API token obtained from the query params.

Callers 1

middlewareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected