Skip to content

Commit e23cfca

Browse files
author
haoxin
committedJul 9, 2017
throw error if error status not 404
closes #106
1 parent 1328f78 commit e23cfca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ function serve (root, opts) {
4343
try {
4444
done = await send(ctx, ctx.path, opts)
4545
} catch (err) {
46+
if (err.status !== 404) {
47+
throw err
48+
}
4649
}
4750
}
4851

@@ -62,7 +65,9 @@ function serve (root, opts) {
6265
try {
6366
await send(ctx, ctx.path, opts)
6467
} catch (err) {
65-
ctx.status = err.status || 500
68+
if (err.status !== 404) {
69+
throw err
70+
}
6671
}
6772
}
6873
}

0 commit comments

Comments
 (0)
Please sign in to comment.