aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm/anki.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-02-20 09:35:54 -0500
committerGitHub <noreply@github.com>2022-02-20 09:35:54 -0500
commit48b2807120928654ae52ea78bd7d2d9824eaa05e (patch)
tree9732815074e7343fa38f8a6e91f7d8af9ab72b58 /ext/js/comm/anki.js
parent045eb63a52697b4436c935d4db1716762fef5eb8 (diff)
Add support for logging Anki errors on the settings page (#2073)
Diffstat (limited to 'ext/js/comm/anki.js')
-rw-r--r--ext/js/comm/anki.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/comm/anki.js b/ext/js/comm/anki.js
index 3254873f..54b12384 100644
--- a/ext/js/comm/anki.js
+++ b/ext/js/comm/anki.js
@@ -183,7 +183,7 @@ class AnkiConnect {
});
} catch (e) {
const error = new Error('Anki connection failure');
- error.data = {action, params};
+ error.data = {action, params, originalError: e};
throw error;
}
@@ -200,7 +200,7 @@ class AnkiConnect {
result = JSON.parse(responseText);
} catch (e) {
const error = new Error('Invalid Anki response');
- error.data = {action, params, status: response.status, responseText};
+ error.data = {action, params, status: response.status, responseText, originalError: e};
throw error;
}