summaryrefslogtreecommitdiff
path: root/ext/http/00_serve.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http/00_serve.js')
-rw-r--r--ext/http/00_serve.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js
index 33742e122..6aed08bdd 100644
--- a/ext/http/00_serve.js
+++ b/ext/http/00_serve.js
@@ -37,14 +37,15 @@ import {
import { TcpConn } from "ext:deno_net/01_net.js";
const {
ObjectPrototypeIsPrototypeOf,
+ PromisePrototypeCatch,
SafeSet,
SafeSetIterator,
SetPrototypeAdd,
SetPrototypeDelete,
Symbol,
TypeError,
- Uint8ArrayPrototype,
Uint8Array,
+ Uint8ArrayPrototype,
} = primordials;
const {
@@ -667,7 +668,7 @@ async function serve(arg1, arg2) {
if (req === 0xffffffff) {
break;
}
- callback(req).catch((error) => {
+ PromisePrototypeCatch(callback(req), (error) => {
// Abnormal exit
console.error(
"Terminating Deno.serve loop due to unexpected error",