Skip to content
Snippets Groups Projects
Commit cb2a94ae authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Improved cmdline exception handling

parent bb4c5e00
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,14 @@ int CTACopyCmd::main(const int argc, const char **argv) const throw() {
// Execute the command
try {
rc = sendCommand(argc, argv);
} catch(std::exception &ex) {
std::cerr << std::endl << "Failed to execute the command. Reason: " << ex.what() << std::endl;
} catch(cta::exception::Exception &ex) {
std::cerr << "Failed to execute the command. Reason: " << ex.getMessageValue() << std::endl;
return 1;
} catch (std::exception &ex) {
std::cerr << "Failed to execute the command. Reason: " << ex.what() << std::endl;
return 1;
} catch (...) {
std::cerr << "Failed to execute the command for an unknown reason" << std::endl;
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment