diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-21 20:42:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 20:42:48 -0400 |
commit | bdc97b3976786bb744a27e59b0f4f28554a682df (patch) | |
tree | bf4635ad903de542c10620e95adb72eee03d9204 /js/errors.ts | |
parent | b764d1b8ffc4bf5e2ab89bdbd978d708a6da0f24 (diff) |
Organize dispatch a bit (#2796)
Just some clean up reorganization around flatbuffer/minimal dispatch
code. This is prep for adding a JSON dispatcher.
Diffstat (limited to 'js/errors.ts')
-rw-r--r-- | js/errors.ts | 20 |
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; - } -} |