From 22acdd87c367d7e51d2810bba847c6c22d62d19e Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 25 Apr 2012 22:23:15 +0900 Subject: [PATCH] Print backtrace for internal_error. --- src/main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cc b/src/main.cc index 25855daf..60e0c314 100644 --- a/src/main.cc +++ b/src/main.cc @@ -875,10 +875,20 @@ main(int argc, char** argv) { control->core()->download_list()->session_save(); control->cleanup(); + } catch (torrent::internal_error& e) { + control->cleanup_exception(); + + std::cout << "Caught internal_error: " << e.what() << std::endl + << e.backtrace(); + lt_log_print_dump(torrent::LOG_CRITICAL, e.backtrace().c_str(), e.backtrace().size(), + "Caught internal_error: '%s'.", e.what()); + return -1; + } catch (std::exception& e) { control->cleanup_exception(); std::cout << "rtorrent: " << e.what() << std::endl; + lt_log_print(torrent::LOG_CRITICAL, "Caught exception: '%s'.", e.what()); return -1; }