Check errors for endpoint multi

This commit is contained in:
louie 2019-06-07 19:47:28 +08:00
parent 986b1ee398
commit 805bd238db

View file

@ -174,7 +174,10 @@ See https://apps.ankiweb.net/docs/manual.html#latex-conflicts.")
.result))
(defun anki-editor--anki-connect-invoke-multi (&rest actions)
(-zip-with (lambda (result handler) (and handler (funcall handler result)))
(-zip-with (lambda (result handler)
(when-let ((err (alist-get 'error result)))
(error err))
(and handler (funcall handler result)))
(anki-editor--anki-connect-invoke-result
"multi" `((actions . ,(mapcar #'car actions))))
(mapcar #'cdr actions)))