summaryrefslogtreecommitdiff
path: root/std/io/iotest.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/io/iotest.ts')
-rw-r--r--std/io/iotest.ts11
1 files changed, 2 insertions, 9 deletions
diff --git a/std/io/iotest.ts b/std/io/iotest.ts
index 8d2cee6e2..1e922e33f 100644
--- a/std/io/iotest.ts
+++ b/std/io/iotest.ts
@@ -36,14 +36,7 @@ export class HalfReader implements Reader {
}
}
-export class ErrTimeout extends Error {
- constructor() {
- super("timeout");
- this.name = "ErrTimeout";
- }
-}
-
-/** TimeoutReader returns ErrTimeout on the second read
+/** TimeoutReader returns `Deno.errors.TimedOut` on the second read
* with no data. Subsequent calls to read succeed.
*/
export class TimeoutReader implements Reader {
@@ -53,7 +46,7 @@ export class TimeoutReader implements Reader {
async read(p: Uint8Array): Promise<number | Deno.EOF> {
this.count++;
if (this.count === 2) {
- throw new ErrTimeout();
+ throw new Deno.errors.TimedOut();
}
return this.r.read(p);
}