[PATCH] cli/new: improve error reporting

classic Classic list List threaded Threaded
2 messages Options
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

[PATCH] cli/new: improve error reporting

Recently a user reported a crash in notmuch new, but because of
missing error reporting, all they could say was "A Xapian exception
occured". This commit adds the extra information available about
the error message in the exception.
---
 notmuch-new.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index 3a60f7ca..16b4d022 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -291,8 +291,7 @@ add_file (notmuch_database_t *notmuch, const char *filename,
     case NOTMUCH_STATUS_READ_ONLY_DATABASE:
     case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
     case NOTMUCH_STATUS_OUT_OF_MEMORY:
- fprintf (stderr, "Error: %s. Halting processing.\n",
- notmuch_status_to_string (status));
+ (void) print_status_database("add_file", notmuch, status);
  goto DONE;
     default:
  INTERNAL_ERROR ("add_message returned unexpected value: %d", status);
--
2.13.2

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/new: improve error reporting

David Bremner <[hidden email]> writes:

> Recently a user reported a crash in notmuch new, but because of
> missing error reporting, all they could say was "A Xapian exception
> occured". This commit adds the extra information available about
> the error message in the exception.

pushed to master. Actually, I think another user reported the unhelpful
xapian exception recently.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch