diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-21 10:36:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-21 10:36:13 -0500 |
commit | dd8a10948195f231a6a9eb652e3f208813904ad6 (patch) | |
tree | f9a4afeb67bbead882c29c2458a5f1f99e2e42db /cli/js/dispatch_json.ts | |
parent | d9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff) |
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'cli/js/dispatch_json.ts')
-rw-r--r-- | cli/js/dispatch_json.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/js/dispatch_json.ts b/cli/js/dispatch_json.ts index adccb69c6..b0859e1ba 100644 --- a/cli/js/dispatch_json.ts +++ b/cli/js/dispatch_json.ts @@ -2,7 +2,7 @@ import * as util from "./util.ts"; import { TextEncoder, TextDecoder } from "./text_encoding.ts"; import { core } from "./core.ts"; -import { ErrorKind, DenoError } from "./errors.ts"; +import { ErrorKind, constructError } from "./errors.ts"; // eslint-disable-next-line @typescript-eslint/no-explicit-any type Ok = any; @@ -37,7 +37,7 @@ function encode(args: object): Uint8Array { function unwrapResponse(res: JsonResponse): Ok { if (res.err != null) { - throw new DenoError(res.err!.kind, res.err!.message); + return constructError(res.err!.kind, res.err!.message); } util.assert(res.ok != null); return res.ok; |