catch boost::bad_function_call exceptions in server command handler
Don't know if this can actually happen in practice but it is reported by coverity.
This commit is contained in:
parent
bb9aabd1b8
commit
8f9f3dd6f5
1 changed files with 6 additions and 1 deletions
|
@ -1387,7 +1387,12 @@ std::string server::process_command(std::string query, std::string issuer_name)
|
|||
out << "Command '" << command << "' is not recognized.\n" << help_msg;
|
||||
} else {
|
||||
const cmd_handler &handler = handler_itor->second;
|
||||
handler(this, issuer_name, query, parameters, &out);
|
||||
try {
|
||||
handler(this, issuer_name, query, parameters, &out);
|
||||
} catch (boost::bad_function_call & ex) {
|
||||
ERR_SERVER << "While handling a command '" << command << "', caught a boost::bad_function_call exception.\n";
|
||||
ERR_SERVER << ex.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return out.str();
|
||||
|
|
Loading…
Add table
Reference in a new issue