diff options
author | Ian Bull <irbull@eclipsesource.com> | 2024-09-18 18:19:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-18 18:19:45 -0700 |
commit | 282c4c262d3a19fe3ae3fd9ea75811b816e65dc1 (patch) | |
tree | 51ad919b29949215d5b9920097f04d24e062c4a7 /ext/http/01_http.js | |
parent | fd23e8ec4f815f273a348d528edbc3bf65a21b5f (diff) |
refactor(ext): align error messages (#25496)
Aligns the error messages in the ext/http and a few messages in the
ext/fetch folder to be in-line with the Deno style guide.
This change-set also removes some unnecessary checks in the 00_serve.ts.
These options were recently removed, so it doesn't make sense to check
for them anymore.
https://github.com/denoland/deno/issues/25269
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r-- | ext/http/01_http.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js index e88684858..9302bd8a0 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -207,7 +207,7 @@ function createRespondWith( resp = await resp; if (!(ObjectPrototypeIsPrototypeOf(ResponsePrototype, resp))) { throw new TypeError( - "First argument to respondWith must be a Response or a promise resolving to a Response.", + "First argument to 'respondWith' must be a Response or a promise resolving to a Response", ); } @@ -220,7 +220,7 @@ function createRespondWith( let respBody = null; if (innerResp.body !== null) { if (innerResp.body.unusable()) { - throw new TypeError("Body is unusable."); + throw new TypeError("Body is unusable"); } if ( ObjectPrototypeIsPrototypeOf( @@ -295,7 +295,7 @@ function createRespondWith( let reader; if (resourceBacking) { if (respBody.locked) { - throw new TypeError("ReadableStream is locked."); + throw new TypeError("ReadableStream is locked"); } reader = respBody.getReader(); // Acquire JS lock. try { |