summaryrefslogtreecommitdiff
path: root/tests/unit/net_test.ts
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-09-27 16:07:20 +0200
committerGitHub <noreply@github.com>2024-09-27 14:07:20 +0000
commit3134abefa462ead8bb8e2e4aa8a5b57910f3d430 (patch)
tree0f01cca8ca91ea6fb06347f17a77091259749c28 /tests/unit/net_test.ts
parent88a4f8dd97704b8905d05def949b137a75286b18 (diff)
BREAKING(ext/net): improved error code accuracy (#25383)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/unit/net_test.ts')
-rw-r--r--tests/unit/net_test.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/unit/net_test.ts b/tests/unit/net_test.ts
index c243da47f..cfa42b3d3 100644
--- a/tests/unit/net_test.ts
+++ b/tests/unit/net_test.ts
@@ -126,8 +126,6 @@ Deno.test(
const listener = Deno.listen({ port: listenPort });
const p = listener.accept();
listener.close();
- // TODO(piscisaureus): the error type should be `Interrupted` here, which
- // gets thrown, but then ext/net catches it and rethrows `BadResource`.
await assertRejects(
() => p,
Deno.errors.BadResource,
@@ -168,7 +166,7 @@ Deno.test(
} else if (e.message === "Another accept task is ongoing") {
acceptErrCount++;
} else {
- throw new Error("Unexpected error message");
+ throw e;
}
};
const p = listener.accept().catch(checkErr);