unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* More usable error messages when exceptions are not caught
@ 2022-12-02 19:05 Thomas Schneider
  2022-12-04  2:28 ` handle exceptions in _notmuch_message_delete David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Schneider @ 2022-12-02 19:05 UTC (permalink / raw)
  To: notmuch

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

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

end of thread, other threads:[~2022-12-27 16:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 19:05 More usable error messages when exceptions are not caught Thomas Schneider
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

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).