emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 60dafa7 3/4: [vcard] Don't swallow vCard parsing errors


From: Eric Abrahamsen
Subject: [elpa] master 60dafa7 3/4: [vcard] Don't swallow vCard parsing errors
Date: Sat, 14 Mar 2020 16:08:46 -0400 (EDT)

branch: master
commit 60dafa7ccd3c8cd14d636a1a6f9224f7450a0913
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    [vcard] Don't swallow vCard parsing errors
    
    * packages/vcard/vcard-parse.el (vcard-parse-buffer): Use lwarn and
    try to provide some useful information.
---
 packages/vcard/vcard-parse.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/packages/vcard/vcard-parse.el b/packages/vcard/vcard-parse.el
index dfddda4..56afd30 100644
--- a/packages/vcard/vcard-parse.el
+++ b/packages/vcard/vcard-parse.el
@@ -212,10 +212,16 @@ Returns a list of contact objects."
     ;; with a `skip-syntax-forward' check.
 
     (while (re-search-forward "^BEGIN:VCARD\n" (line-end-position 2) t)
-      (when (setq card (ignore-errors
-                        ;; `vcard-parse-card' moves point past the
-                        ;; card.
-                        (vcard-parse-card prop-consumer card-consumer)))
+      (when (setq card (condition-case nil
+                          ;; `vcard-parse-card' moves point past the
+                          ;; card.
+                          (vcard-parse-card prop-consumer card-consumer)
+                        (error (lwarn
+                                  '(vcard) :error
+                                  "Parsing failed with:\n %s"
+                                  (buffer-substring-no-properties
+                                   (point-at-bol)
+                                   (point-at-eol))))))
        (push card out)))
 
     (nreverse out)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]