mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 14:55:52 +08:00
Refactor a few more catch(...)
instances
This commit is contained in:
parent
f9184f3564
commit
8b7f0c5359
@ -204,18 +204,6 @@ AvrDude::Ptr AvrDude::run()
|
|||||||
message_fn("\n", 1);
|
message_fn("\n", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->p->complete_fn) {
|
|
||||||
self->p->complete_fn();
|
|
||||||
}
|
|
||||||
} catch (...) {
|
|
||||||
self->p->exit_code = EXIT_EXCEPTION;
|
|
||||||
|
|
||||||
static const char *msg = "An unkown exception was thrown in the background thread.\n";
|
|
||||||
|
|
||||||
if (self->p->message_fn) {
|
|
||||||
self->p->message_fn(msg, sizeof(msg));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self->p->complete_fn) {
|
if (self->p->complete_fn) {
|
||||||
self->p->complete_fn();
|
self->p->complete_fn();
|
||||||
}
|
}
|
||||||
|
@ -139,9 +139,6 @@ static void generic_exception_handle()
|
|||||||
wxLogError("Internal error: %s", ex.what());
|
wxLogError("Internal error: %s", ex.what());
|
||||||
BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
|
BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
|
||||||
throw;
|
throw;
|
||||||
} catch (...) {
|
|
||||||
wxLogError("Unknown internal error");
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "Uncaught exception: Unknown error";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +166,7 @@ bool GUI_App::OnInit()
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return on_init_inner();
|
return on_init_inner();
|
||||||
} catch (...) {
|
} catch (const std::exception&) {
|
||||||
generic_exception_handle();
|
generic_exception_handle();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ optional<unsigned long> sysfs_tty_prop_hex(const std::string &tty_dev, const std
|
|||||||
if (!prop) { return boost::none; }
|
if (!prop) { return boost::none; }
|
||||||
|
|
||||||
try { return std::stoul(*prop, 0, 16); }
|
try { return std::stoul(*prop, 0, 16); }
|
||||||
catch (...) { return boost::none; }
|
catch (const std::exception&) { return boost::none; }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user