unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
@ 2012-10-21 12:58 Tomi Ollila
  0 siblings, 0 replies; 7+ messages in thread
From: Tomi Ollila @ 2012-10-21 12:58 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

When inserting of email bodypart failes, insert a failure message
to the buffer (and continue) instead of halting the insertion of
the rest of that email thread in question.
---

The failure of inserting bodyparts can be experienced in thread
starting with 

id:"m31ul3qo4w.fsf@quad.robs.office"

the email id:"87d31artti.fsf@inf-8657.int-evry.fr"
makes the halt happen -- when this patch is applied
the message !!! bodypart insertion error !!! appears in the
buffer.

for example the email id:"87mwzgxq5l.fsf@inf-8657.int-evry.fr"

is not shown in that thread until this patch is applied.

Whenever everyone can read these emails we can try to figure
out why id:"1349333712-18347-1-git-send-email-tomi.ollila@iki.fi"
did not fix some calendar bodypart for Olivier.

Tomi

 emacs/notmuch-show.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f273eb4..651a5ee 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -815,7 +815,9 @@ message at DEPTH in the current thread."
     ;; Run the content handlers until one of them returns a non-nil
     ;; value.
     (while (and handlers
-		(not (funcall (car handlers) msg part content-type nth depth declared-type)))
+		(not (condition-case nil
+			 (funcall (car handlers) msg part content-type nth depth declared-type)
+		       (error (progn (insert "!!! bodypart insert error !!!\n") nil)))))
       (setq handlers (cdr handlers))))
   t)
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
@ 2012-10-21 13:20 Tomi Ollila
  2012-10-21 13:26 ` Tomi Ollila
  0 siblings, 1 reply; 7+ messages in thread
From: Tomi Ollila @ 2012-10-21 13:20 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

When inserting of email bodypart failes, insert a failure message
to the buffer (and continue) instead of halting the insertion of
the rest of that email thread in question.
---

This is alternative to 

id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"

This adds error message string to the output, error message in
id:"87d31artti.fsf@inf-8657.int-evry.fr" is shown as

  !!! bodypart insert error: Wrong type argument: stringp, nil !!!

See id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"
for more discussion.

 emacs/notmuch-show.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f273eb4..651a5ee 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -815,7 +815,9 @@ message at DEPTH in the current thread."
     ;; Run the content handlers until one of them returns a non-nil
     ;; value.
     (while (and handlers
-		(not (funcall (car handlers) msg part content-type nth depth declared-type)))
+		(not (condition-case nil
+			 (funcall (car handlers) msg part content-type nth depth declared-type)
+		       (error (progn (insert "!!! bodypart insert error !!!\n") nil)))))
       (setq handlers (cdr handlers))))
   t)
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
  2012-10-21 13:20 Tomi Ollila
@ 2012-10-21 13:26 ` Tomi Ollila
  0 siblings, 0 replies; 7+ messages in thread
From: Tomi Ollila @ 2012-10-21 13:26 UTC (permalink / raw)
  To: notmuch

On Sun, Oct 21 2012, Tomi Ollila wrote:

> When inserting of email bodypart failes, insert a failure message
> to the buffer (and continue) instead of halting the insertion of
> the rest of that email thread in question.
> ---
>
> This is alternative to 
>
> id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"

So, I screwed with git commit --amend (git add forgotten I presume)
and the same content is in this patch. 

Please ignore

Sorry for the inconvenience.

Tomi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
@ 2012-10-21 13:35 Tomi Ollila
  2012-10-21 14:10 ` Ethan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tomi Ollila @ 2012-10-21 13:35 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

When inserting of email bodypart failes, insert a failure message
to the buffer (and continue) instead of halting the insertion of
the rest of that email thread in question.
---
This is (now real !!!) alternative to

id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"

This adds error message string to the output, error message in
id:"87d31artti.fsf@inf-8657.int-evry.fr" is shown as

  !!! Bodypart insert error: Wrong type argument: stringp, nil !!!

See id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"
for more discussion.

 emacs/notmuch-show.el |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f273eb4..d061367 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -815,7 +815,12 @@ message at DEPTH in the current thread."
     ;; Run the content handlers until one of them returns a non-nil
     ;; value.
     (while (and handlers
-		(not (funcall (car handlers) msg part content-type nth depth declared-type)))
+		(not (condition-case err
+			 (funcall (car handlers) msg part content-type nth depth declared-type)
+		       (error (progn
+				(insert "!!! Bodypart insert error: ")
+				(insert (error-message-string err))
+				(insert " !!!\n") nil)))))
       (setq handlers (cdr handlers))))
   t)
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
  2012-10-21 13:35 [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error Tomi Ollila
@ 2012-10-21 14:10 ` Ethan
  2012-10-31 20:35 ` David Bremner
  2012-11-07 12:10 ` David Bremner
  2 siblings, 0 replies; 7+ messages in thread
From: Ethan @ 2012-10-21 14:10 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

On Sun, Oct 21, 2012 at 9:35 AM, Tomi Ollila <tomi.ollila@iki.fi> wrote:

> When inserting of email bodypart failes, insert a failure message
> to the buffer (and continue) instead of halting the insertion of
> the rest of that email thread in question.
> ---
> This is (now real !!!) alternative to
>
> id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"
>
> This adds error message string to the output, error message in
> id:"87d31artti.fsf@inf-8657.int-evry.fr" is shown as
>
>   !!! Bodypart insert error: Wrong type argument: stringp, nil !!!
>

This seems like a really good idea generally. I think we should merge this
anyhow.

Ethan

[-- Attachment #2: Type: text/html, Size: 1142 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
  2012-10-21 13:35 [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error Tomi Ollila
  2012-10-21 14:10 ` Ethan
@ 2012-10-31 20:35 ` David Bremner
  2012-11-07 12:10 ` David Bremner
  2 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2012-10-31 20:35 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

Tomi Ollila <tomi.ollila@iki.fi> writes:

> When inserting of email bodypart failes, insert a failure message
> to the buffer (and continue) instead of halting the insertion of
> the rest of that email thread in question.

I'm not totally sure about inserting error messages into the buffer, but
it seems like an improvement on what we have, so I'm untagging
needs-review.

Anybody who doesn't like it, speak up ;)

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
  2012-10-21 13:35 [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error Tomi Ollila
  2012-10-21 14:10 ` Ethan
  2012-10-31 20:35 ` David Bremner
@ 2012-11-07 12:10 ` David Bremner
  2 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2012-11-07 12:10 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

Tomi Ollila <tomi.ollila@iki.fi> writes:

> When inserting of email bodypart failes, insert a failure message
> to the buffer (and continue) instead of halting the insertion of
> the rest of that email thread in question.

Pushed,

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-07 12:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-21 13:35 [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error Tomi Ollila
2012-10-21 14:10 ` Ethan
2012-10-31 20:35 ` David Bremner
2012-11-07 12:10 ` David Bremner
  -- strict thread matches above, loose matches on Subject: below --
2012-10-21 13:20 Tomi Ollila
2012-10-21 13:26 ` Tomi Ollila
2012-10-21 12:58 Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).