MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / errorHandler

Function errorHandler

api/src/routes/protected/settings.ts:863–872  ·  view source on GitHub ↗
(error, request, reply)

Source from the content-addressed store, hash-verified

861 {
862 schema: schemas.confirmEmail,
863 errorHandler(error, request, reply) {
864 const logger = fastify.log.child({ req: request });
865 if (error.validation) {
866 logger.warn({ validationError: error.validation });
867 const { origin } = getRedirectParams(request);
868 void reply.redirectWithMessage(origin, redirectMessage);
869 } else {
870 fastify.errorHandler(error, request, reply);
871 }
872 }
873 },
874 async (req, reply) => {
875 const logger = fastify.log.child({ req, res: reply });

Callers

nothing calls this directly

Calls 1

getRedirectParamsFunction · 0.85

Tested by

no test coverage detected