# # patch "ChangeLog" # from [755d58f388c16d13e6257b19381531bf7151ddcd] # to [7977112837eb09182fb6799e38a65102597ada8c] # # patch "main.cc" # from [f5427f1b85d11caddbc2732f049250698bbdb6c3] # to [24910dffe664f34ffa8bb09e201ed03631dec629] # # patch "monotone.cc" # from [a757a2bc5e96c1020a8fb9a206a4df2ca7571584] # to [5781246877c376fef884c42a387937348a33ce52] # --- ChangeLog +++ ChangeLog @@ -1,7 +1,10 @@ 2005-05-30 Matt Johnston * netsync.cc: cosmetic linebreak tidying for "double-check the fingerprint" message. + * main.cc: make it clearer that "unknown type" refers to an exception + * monotone.cc: catch early informative_failures (due to charset + problems etc) 2005-05-30 Matt Johnston --- main.cc +++ main.cc @@ -444,7 +444,7 @@ catch( ... ) { - report_error("unknown type" ); + report_error("exception of unknown type" ); } return 0; } --- monotone.cc +++ monotone.cc @@ -211,6 +211,7 @@ cpp_main(int argc, char ** argv) { clean_shutdown = false; + int ret = 0; atexit(&dumper); @@ -221,7 +222,13 @@ bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + + // we want to catch any early informative_failures due to charset + // conversion etc + try { + + { std::ostringstream cmdline_ss; for (int i = 0; i < argc; ++i) { @@ -253,7 +260,6 @@ // process main program options - int ret = 0; int opt; bool requested_help = false; set used_local_options; @@ -469,12 +475,13 @@ clean_shutdown = true; return 0; } + } catch (informative_failure & inf) - { - ui.inform(inf.what); - clean_shutdown = true; - return 1; - } + { + ui.inform(inf.what); + clean_shutdown = true; + return 1; + } clean_shutdown = true; return ret;