Skip to content

Commit

Permalink
Log app error
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshschuler committed May 30, 2023
1 parent b7eaf34 commit 7517e02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/src/middleware/handleError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export async function handleError(ctx: RouterContext<string>, next: () => Promis
await next();
} catch (err) {
await logError("Application Error", { ...err, message: err.message });
console.error({ ...err });

ctx.response.status = 500;
ctx.response.body = { message: "Something went wrong processing your request. Please try again later." };
Expand Down

0 comments on commit 7517e02

Please sign in to comment.