diff options
Diffstat (limited to 'js/errors.ts')
-rw-r--r-- | js/errors.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/errors.ts b/js/errors.ts index d0254ef65..72fc5f23b 100644 --- a/js/errors.ts +++ b/js/errors.ts @@ -1,25 +1,25 @@ -import * as fbs from "gen/msg_generated"; +import * as msg from "gen/msg_generated"; export { ErrorKind } from "gen/msg_generated"; // @internal -export class DenoError<T extends fbs.ErrorKind> extends Error { - constructor(readonly kind: T, msg: string) { - super(msg); - this.name = fbs.ErrorKind[kind]; +export class DenoError<T extends msg.ErrorKind> extends Error { + constructor(readonly kind: T, errStr: string) { + super(errStr); + this.name = msg.ErrorKind[kind]; } } // @internal -export function maybeThrowError(base: fbs.Base): void { +export function maybeThrowError(base: msg.Base): void { const err = maybeError(base); if (err != null) { throw err; } } -export function maybeError(base: fbs.Base): null | DenoError<fbs.ErrorKind> { +export function maybeError(base: msg.Base): null | DenoError<msg.ErrorKind> { const kind = base.errorKind(); - if (kind === fbs.ErrorKind.NoError) { + if (kind === msg.ErrorKind.NoError) { return null; } else { return new DenoError(kind, base.error()!); |