Commit 4ef88751 authored by Ge Jun's avatar Ge Jun

Catch std::string and const char* for thrift callback which may throws the stuffs as well

parent cf9e2f71
...@@ -393,8 +393,12 @@ inline void ProcessThriftFramedRequestNoExcept(ThriftService* service, ...@@ -393,8 +393,12 @@ inline void ProcessThriftFramedRequestNoExcept(ThriftService* service,
// we can still set `cntl' in the catch branch. // we can still set `cntl' in the catch branch.
try { try {
service->ProcessThriftFramedRequest(cntl, req, res, done); service->ProcessThriftFramedRequest(cntl, req, res, done);
} catch (::apache::thrift::TException& e) { } catch (std::exception& e) {
cntl->SetFailed(EINTERNAL, "Catched exception: %s", e.what()); cntl->SetFailed(EINTERNAL, "Catched exception: %s", e.what());
} catch (std::string& e) {
cntl->SetFailed(EINTERNAL, "Catched std::string: %s", e.c_str());
} catch (const char* e) {
cntl->SetFailed(EINTERNAL, "Catched const char*: %s", e);
} catch (...) { } catch (...) {
cntl->SetFailed(EINTERNAL, "Catched unknown exception"); cntl->SetFailed(EINTERNAL, "Catched unknown exception");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment