Practice ยท 3 of 3
Error Boundary
Write withErrorBoundary(handler) returning a wrapped function (input) => output-object. When handler succeeds, return { status: 200, body: result }. When it throws an Error with .status, return { status: err.status, body: { error: err.message } }. Any other throw => { status: 500, body: { error: "internal error" } } โ the original message must NOT appear.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Middleware Pipeline โ Practice