| 398 | } |
| 399 | |
| 400 | inline void ProcessThriftFramedRequestNoExcept(ThriftService* service, Controller* cntl, |
| 401 | ThriftFramedMessage* req, ThriftFramedMessage* res, |
| 402 | ThriftClosure* done) { |
| 403 | // NOTE: done is not actually run before ResumeRunning() is called so that |
| 404 | // we can still set `cntl' in the catch branch. |
| 405 | done->SuspendRunning(); |
| 406 | try { |
| 407 | service->ProcessThriftFramedRequest(cntl, req, res, done); |
| 408 | } catch (std::exception& e) { |
| 409 | cntl->SetFailed(EINTERNAL, "Catched exception: %s", e.what()); |
| 410 | } catch (std::string& e) { |
| 411 | cntl->SetFailed(EINTERNAL, "Catched std::string: %s", e.c_str()); |
| 412 | } catch (const char* e) { |
| 413 | cntl->SetFailed(EINTERNAL, "Catched const char*: %s", e); |
| 414 | } catch (...) { |
| 415 | cntl->SetFailed(EINTERNAL, "Catched unknown exception"); |
| 416 | } |
| 417 | done->ResumeRunning(); |
| 418 | } |
| 419 | |
| 420 | namespace { |
| 421 | struct CallMethodInBackupThreadArgs { |
no test coverage detected