Skip to content

Commit

Permalink
added async support to error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
halvardssm committed Jul 12, 2020
1 parent 0199f8f commit 1c85586
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install deno
uses: denolib/setup-deno@master
with:
deno-version: 1.1.3
deno-version: ${{env.DENO_VERSION}}
- name: Check formatting
run: deno fmt --check
- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions src/errorMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const errorHandlerMiddleware = <
await next();
} catch (err) {
if (cases?.[err.status]) {
cases[err.status](err, ctx);
await cases[err.status](err, ctx);
} else {
fallback(err, ctx);
await fallback(err, ctx);
}
}
};
Expand Down

0 comments on commit 1c85586

Please sign in to comment.