Function type for transforming errors
Error transforms allow you to customize error handling globally. They are executed in registration order for all errors.
The transformed error (can be the same or a new error)
const errorTransform: ErrorTransform = async (error, ctx) => { const enhancedError = new Error(`[${ctx.request.url}] ${error.message}`); enhancedError.stack = error.stack; return enhancedError;}; Copy
const errorTransform: ErrorTransform = async (error, ctx) => { const enhancedError = new Error(`[${ctx.request.url}] ${error.message}`); enhancedError.stack = error.stack; return enhancedError;};
Function type for transforming errors
Error transforms allow you to customize error handling globally. They are executed in registration order for all errors.
Returns
The transformed error (can be the same or a new error)
Example