From: Thomas Schneider <qsx@chaotikum.eu>
To: notmuch@notmuchmail.org
Subject: More usable error messages when exceptions are not caught
Date: Fri, 02 Dec 2022 20:05:02 +0100 [thread overview]
Message-ID: <wwuk039sk2p.fsf@chaotikum.eu> (raw)
Hi,
it would be nice if the error message notmuch shows when an uncaught
exception occurs was more helpful to the user. It could at least show
the exception message (`e->what()` iirc), which would have helped in
this case.
From IRC:
<qsx> % notmuch new
<qsx> libc++abi: terminating due to uncaught exception of type Xapian::DatabaseError
<qsx> fun
<qsx> does this sound interesting enough to build notmuch and xapian with debug symbols?
[…]
<qsx> but i think the issue is that there’s no space left on the filesystem where the xapian db lives
[…]
<qsx> sounds reasonable
<qsx> but i think it would be nicer for the user if notmuch at least showed the message of the exception, because that was some work to get to this point
Backtrace:
(gdb) p *(Xapian::DatabaseError *)thrown_object
$13 = {<Xapian::RuntimeError> = {<Xapian::Error> = {msg = {static __endian_factor = 2,
__r_ = {<std::__1::__compressed_pair_elem<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, 0, false>> = {__value_ = {{__l = {{__is_long_ = 1, __cap_ = 16},
__size_ = 25, __data_ = 0x555582cd4fc0 "Error writing block 83232"}, __s = {{__is_long_ = 1 '\001', __size_ = 16 '\020'}, __padding_ = 0x555555c15e61 "",
__data_ = "\000\000\000\000\000\000\000\031\000\000\000\000\000\000\000\300O͂UU\000"}, __r = {__words = {33, 25,
93825755074496}}}}}, <std::__1::__compressed_pair_elem<std::__1::allocator<char>, 1, true>> = {<std::__1::allocator<char>> = {<std::__1::__non_trivial_if<true, std::__1::allocator<char> >> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, static npos = 18446744073709551615}, context = {static __endian_factor = 2,
__r_ = {<std::__1::__compressed_pair_elem<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, 0, false>> = {__value_ = {{__l = {{__is_long_ = 0, __cap_ = 0},
__size_ = 0, __data_ = 0x0}, __s = {{__is_long_ = 0 '\000', __size_ = 0 '\000'}, __padding_ = 0x555555c15e79 "", __data_ = '\000' <repeats 22 times>}, __r = {__words = {0, 0,
0}}}}}, <std::__1::__compressed_pair_elem<std::__1::allocator<char>, 1, true>> = {<std::__1::allocator<char>> = {<std::__1::__non_trivial_if<true, std::__1::allocator<char> >> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, static npos = 18446744073709551615}, error_string = {static __endian_factor = 2,
__r_ = {<std::__1::__compressed_pair_elem<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, 0, false>> = {__value_ = {{__l = {{__is_long_ = 0, __cap_ = 0},
__size_ = 0, __data_ = 0x0}, __s = {{__is_long_ = 0 '\000', __size_ = 0 '\000'}, __padding_ = 0x555555c15e91 "", __data_ = '\000' <repeats 22 times>}, __r = {__words = {0, 0,
0}}}}}, <std::__1::__compressed_pair_elem<std::__1::allocator<char>, 1, true>> = {<std::__1::allocator<char>> = {<std::__1::__non_trivial_if<true, std::__1::allocator<char> >> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, static npos = 18446744073709551615}, type = 0x7ffff797410c <str.17.llvm> "\004DatabaseError", my_errno = 28,
already_handled = false}, <No data fields>}, <No data fields>}
--qsx\r
next reply other threads:[~2022-12-02 19:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 19:05 Thomas Schneider [this message]
2022-12-04 2:28 ` handle exceptions in _notmuch_message_delete David Bremner
2022-12-04 2:28 ` [PATCH 1/3] lib/database: propagate status code from _notmuch_message_delete David Bremner
2022-12-26 0:04 ` Tomi Ollila
2022-12-27 16:05 ` David Bremner
2022-12-04 2:28 ` [PATCH 2/3] test: add known broken test for exception handling in _n_m_delete David Bremner
2022-12-04 2:28 ` [PATCH 3/3] lib/message: move xapian call inside try/catch block " David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wwuk039sk2p.fsf@chaotikum.eu \
--to=qsx@chaotikum.eu \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).