diff options
Diffstat (limited to 'js/errors.ts')
-rw-r--r-- | js/errors.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/js/errors.ts b/js/errors.ts index cd68003f9..452b2372e 100644 --- a/js/errors.ts +++ b/js/errors.ts @@ -5,14 +5,17 @@ export { ErrorKind } from "gen/msg_generated"; /** A Deno specific error. The `kind` property is set to a specific error code * which can be used to in application logic. * - * import { DenoError, ErrorKind } from "deno"; - * try { - * somethingThatMightThrow(); - * } catch (e) { - * if (e instanceof DenoError && e.kind === ErrorKind.Overflow) { - * console.error("Overflow error!"); + * try { + * somethingThatMightThrow(); + * } catch (e) { + * if ( + * e instanceof Deno.DenoError && + * e.kind === Deno.ErrorKind.Overflow + * ) { + * console.error("Overflow error!"); + * } * } - * } + * */ export class DenoError<T extends ErrorKind> extends Error { constructor(readonly kind: T, msg: string) { |