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 /tests/unit | |
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 'tests/unit')
-rw-r--r-- | tests/unit/serve_test.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index d417d8d26..439d71d55 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -1592,7 +1592,7 @@ Deno.test( Deno.upgradeWebSocket(request); }, Deno.errors.Http, - "already upgraded", + "Already upgraded", ); socket.onerror = (e) => { console.error(e); @@ -3694,7 +3694,7 @@ Deno.test( } catch (cloneError) { assert(cloneError instanceof TypeError); assert( - cloneError.message.endsWith("Body is unusable."), + cloneError.message.endsWith("Body is unusable"), ); ac.abort(); @@ -3743,7 +3743,7 @@ Deno.test({ } catch (cloneError) { assert(cloneError instanceof TypeError); assert( - cloneError.message.endsWith("Body is unusable."), + cloneError.message.endsWith("Body is unusable"), ); ac.abort(); @@ -3895,7 +3895,7 @@ async function readTrailers( const tp = new TextProtoReader(r); const result = await tp.readMimeHeader(); if (result == null) { - throw new Deno.errors.InvalidData("Missing trailer header."); + throw new Deno.errors.InvalidData("Missing trailer header"); } const undeclared = [...result.keys()].filter( (k) => !trailerNames.includes(k), @@ -3923,7 +3923,7 @@ function parseTrailer(field: string | null): Headers | undefined { } const trailerNames = field.split(",").map((v) => v.trim().toLowerCase()); if (trailerNames.length === 0) { - throw new Deno.errors.InvalidData("Empty trailer header."); + throw new Deno.errors.InvalidData("Empty trailer header"); } const prohibited = trailerNames.filter((k) => isProhibitedForTrailer(k)); if (prohibited.length > 0) { |