aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-07 20:46:02 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-08 21:32:08 -0400
commit88de4271843197d37243a9ac360236f9dfb414e1 (patch)
treebef12c8b20d03db34046eda63b70b716c67e0942 /ext/mixed/js
parentbf5d301685db6c31ea64771dab59610586bc1619 (diff)
Throw Error instead of string
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/display.js6
-rw-r--r--ext/mixed/js/extension.js2
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 228e554a..9beb2c52 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -39,11 +39,11 @@ class Display {
}
onError(error) {
- throw 'Override me';
+ throw new Error('Override me');
}
onSearchClear() {
- throw 'Override me';
+ throw new Error('Override me');
}
onSourceTermView(e) {
@@ -386,7 +386,7 @@ class Display {
viewerButton.dataset.noteId = noteId;
}
} else {
- throw 'Note could note be added';
+ throw new Error('Note could not be added');
}
} catch (e) {
this.onError(e);
diff --git a/ext/mixed/js/extension.js b/ext/mixed/js/extension.js
index 5c803132..1a87003d 100644
--- a/ext/mixed/js/extension.js
+++ b/ext/mixed/js/extension.js
@@ -34,7 +34,7 @@ function toIterable(value) {
}
}
- throw 'Could not convert to iterable';
+ throw new Error('Could not convert to iterable');
}
function extensionHasChrome() {