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

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

[elpa] externals/vcard deeb9cd 4/6: [vcard] Don't swallow vCard parsing


From: Stefan Monnier
Subject: [elpa] externals/vcard deeb9cd 4/6: [vcard] Don't swallow vCard parsing errors
Date: Tue, 1 Dec 2020 09:58:07 -0500 (EST)

branch: externals/vcard
commit deeb9cd23e48f10fd42fc0332ed13ae2f0c35acd
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

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

diff --git a/vcard-parse.el b/vcard-parse.el
index dfddda4..56afd30 100644
--- a/vcard-parse.el
+++ b/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]