mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
refactor: remove unneeded ErrorKinds (#3936)
This commit is contained in:
parent
d9efb8c02a
commit
dd8a109481
66 changed files with 553 additions and 620 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue