Skip to content

Commit

Permalink
log other errors too
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysmithTTD committed Jul 29, 2024
1 parent c4e9d9c commit 2327b96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ const defaultRouteHandler: RequestHandler<{}, {}, z.infer<typeof DefaultRouteReq
}

if (!step) {
throw new Error('no step');
logger.log('error', `no step`);
return;
}

const handler = Object.prototype.hasOwnProperty.call(steps, step) && steps[step];
if (!handler) {
throw new Error(`invalid step ${step}`);
logger.log('error', `invalid step ${step}`);
return;
}

await handler(req, res, next);
Expand Down

0 comments on commit 2327b96

Please sign in to comment.