@whatwg-node/server 0.9.15 → 0.9.16-rc-20231023194440-2e7e542
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,10 @@ function createDefaultErrorHandler(ResponseCtor = fetch_1.Response) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
console.error(e);
|
|
15
|
-
|
|
15
|
+
if (ResponseCtor.error) {
|
|
16
|
+
return ResponseCtor.error();
|
|
17
|
+
}
|
|
18
|
+
return new ResponseCtor(null, { status: 500 });
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
exports.createDefaultErrorHandler = createDefaultErrorHandler;
|
|
@@ -9,7 +9,10 @@ export function createDefaultErrorHandler(ResponseCtor = DefaultResponseCtor) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
console.error(e);
|
|
12
|
-
|
|
12
|
+
if (ResponseCtor.error) {
|
|
13
|
+
return ResponseCtor.error();
|
|
14
|
+
}
|
|
15
|
+
return new ResponseCtor(null, { status: 500 });
|
|
13
16
|
};
|
|
14
17
|
}
|
|
15
18
|
export class HTTPError extends Error {
|