summaryrefslogtreecommitdiff
path: root/js/errors.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-10 04:30:38 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-09 12:30:38 -0500
commit034e2cc02829c9244b32232074c7a48af827a2fb (patch)
treebade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/errors.ts
parent8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff)
Migrate from tslint to eslint for linting (#1905)
Diffstat (limited to 'js/errors.ts')
-rw-r--r--js/errors.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/js/errors.ts b/js/errors.ts
index 452b2372e..cefa4a863 100644
--- a/js/errors.ts
+++ b/js/errors.ts
@@ -25,14 +25,6 @@ export class DenoError<T extends ErrorKind> extends Error {
}
// @internal
-export function maybeThrowError(base: Base): void {
- const err = maybeError(base);
- if (err != null) {
- throw err;
- }
-}
-
-// @internal
export function maybeError(base: Base): null | DenoError<ErrorKind> {
const kind = base.errorKind();
if (kind === ErrorKind.NoError) {
@@ -41,3 +33,11 @@ export function maybeError(base: Base): null | DenoError<ErrorKind> {
return new DenoError(kind, base.error()!);
}
}
+
+// @internal
+export function maybeThrowError(base: Base): void {
+ const err = maybeError(base);
+ if (err != null) {
+ throw err;
+ }
+}