MCPcopy Index your code
hub / github.com/hydro-dev/Hydro / onerror

Method onerror

framework/framework/server.ts:257–267  ·  view source on GitHub ↗
(error: HydroError)

Source from the content-addressed store, hash-verified

255 }
256
257 async onerror(error: HydroError) {
258 error.msg ||= () => error.message;
259 console.error(`Error on user request: ${error.msg()}\n`, error);
260 if (error instanceof UserFacingError && !process.env.DEV) error.stack = '';
261 this.response.status = error instanceof UserFacingError ? error.code : 500;
262 this.response.template = error instanceof UserFacingError ? 'error.html' : 'bsod.html';
263 this.response.body = {
264 UserFacingError,
265 error: { message: error.msg(), params: error.params, stack: errorMessage(error.stack || '') },
266 };
267 }
268}
269
270export class ConnectionHandler extends HandlerCommon {

Callers 2

handleHttpMethod · 0.45
cleanMethod · 0.45

Calls 3

errorMessageFunction · 0.90
msgMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected