Skip to content

Commit 9176be1

Browse files
Remove redundant emit call
As ctx.throw() throws an exception, we will never return from the call and emit() is never called. Thus, it can be removed entirely. Fixes #4
1 parent 063b0d1 commit 9176be1

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const koa404Handler = async (ctx, next) => {
44
if (ctx.status === 404) ctx.throw(404);
55
} catch (err) {
66
ctx.throw(err);
7-
ctx.app.emit('error', err, ctx);
87
}
98
};
109

0 commit comments

Comments
 (0)