From b0ecbbe4ad65d5383541ace5f8d70f0e1c167f01 Mon Sep 17 00:00:00 2001 From: orgtre Date: Wed, 2 Nov 2022 11:05:03 +0100 Subject: [PATCH] More informative error message in anki-editor-api-check Increases user-friendliness, as discussed in orgtre/anki-editor#5. --- anki-editor.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/anki-editor.el b/anki-editor.el index 3a29fb6..22945a3 100644 --- a/anki-editor.el +++ b/anki-editor.el @@ -1045,7 +1045,10 @@ When note heading is not provided, it is used as the first field." (interactive) (let ((ver (condition-case err (anki-editor-api-call-result 'version) - (error (error "Failed to connect to Anki: %s" (error-message-string err)))))) + (error (error (concat "Failed to connect to Anki: %s" + "\nIs Anki running with the " + "AnkiConnect add-on enabled?") + (error-message-string err)))))) (if (<= anki-editor-api-version ver) (when (called-interactively-p 'interactive) (message "AnkiConnect v.%d is running" ver))