diff options
author | Oliver Lenehan <sunsetkookaburra+github@outlook.com.au> | 2020-03-14 12:40:13 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 21:40:13 -0400 |
commit | 0f6acf275370cae09ffb3f6950a3926424f3b024 (patch) | |
tree | e77a2115394f36dcbd899fd8f2d5496ca7bde625 /std/io/bufio.ts | |
parent | aab1acaed163f91aa5e89b079c5312336abb2088 (diff) |
fix(std): Use Deno.errors where possible. (#4356)
Diffstat (limited to 'std/io/bufio.ts')
-rw-r--r-- | std/io/bufio.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/std/io/bufio.ts b/std/io/bufio.ts index fa0ba7e73..12b5c2d2b 100644 --- a/std/io/bufio.ts +++ b/std/io/bufio.ts @@ -21,11 +21,11 @@ export class BufferFullError extends Error { } } -export class UnexpectedEOFError extends Error { - name = "UnexpectedEOFError"; +export class PartialReadError extends Deno.errors.UnexpectedEof { + name = "PartialReadError"; partial?: Uint8Array; constructor() { - super("Unexpected EOF"); + super("Encountered UnexpectedEof, data only partially read"); } } @@ -178,7 +178,7 @@ export class BufReader implements Reader { if (bytesRead === 0) { return Deno.EOF; } else { - throw new UnexpectedEOFError(); + throw new PartialReadError(); } } bytesRead += rr; |