summaryrefslogtreecommitdiff
path: root/js/errors.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/errors.ts')
-rw-r--r--js/errors.ts20
1 files changed, 1 insertions, 19 deletions
diff --git a/js/errors.ts b/js/errors.ts
index 42cff60db..717015589 100644
--- a/js/errors.ts
+++ b/js/errors.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { Base, ErrorKind } from "gen/cli/msg_generated";
+import { ErrorKind } from "gen/cli/msg_generated";
export { ErrorKind } from "gen/cli/msg_generated";
/** A Deno specific error. The `kind` property is set to a specific error code
@@ -23,21 +23,3 @@ export class DenoError<T extends ErrorKind> extends Error {
this.name = ErrorKind[kind];
}
}
-
-// @internal
-export function maybeError(base: Base): null | DenoError<ErrorKind> {
- const kind = base.errorKind();
- if (kind === ErrorKind.NoError) {
- return null;
- } else {
- return new DenoError(kind, base.error()!);
- }
-}
-
-// @internal
-export function maybeThrowError(base: Base): void {
- const err = maybeError(base);
- if (err != null) {
- throw err;
- }
-}