diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2018-10-15 07:29:50 +1100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-14 17:38:23 -0400 |
commit | 10a97679ac80b4304c75d33cbc59c5736d11deb1 (patch) | |
tree | b51b9183ed251f61373069e5c4d35e39603bedb2 /js/errors.ts | |
parent | 1840a1971317f5b8fc6e322b3a414b7f8a593c88 (diff) |
Align JSDoc to style guide.
Diffstat (limited to 'js/errors.ts')
-rw-r--r-- | js/errors.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/errors.ts b/js/errors.ts index d6e9713cf..2614c90c5 100644 --- a/js/errors.ts +++ b/js/errors.ts @@ -1,6 +1,18 @@ import { Base, ErrorKind } from "gen/msg_generated"; 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 === DenoError.Overflow) { + * console.error("Overflow error!"); + * } + * } + */ export class DenoError<T extends ErrorKind> extends Error { constructor(readonly kind: T, msg: string) { super(msg); |