Skip to content

Commit 7aec5a2

Browse files
authored
refactor(core): standardize HttpError (#2858)
- Now extends `Error`, so that it satisfies `instanceof Error` operations. - Narrows the `status` property to be an actual HTTP status code. - Outsources default evaluation of the `message` property to `@std/http/status`, which already implements this functionality. - Brings the `stack` property to the class, regardless of its status, which seems like a needless constraint.
1 parent 5876ca7 commit 7aec5a2

File tree

4 files changed

+39
-1638
lines changed

4 files changed

+39
-1638
lines changed

deno.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"exclude": ["**/*_test.*", "src/__OLD/**", "*.todo"]
4141
},
4242
"imports": {
43+
"@std/http": "jsr:@std/http@^1.0.15",
4344
"fresh": "jsr:@fresh/core@^2.0.0-alpha.26",
4445
"preact": "npm:preact@^10.25.1",
4546
"preact-render-to-string": "npm:preact-render-to-string@^6.5.11",

0 commit comments

Comments
 (0)