| 209 | } |
| 210 | |
| 211 | void RpcContext::Panic(const char* filepath, int line_number, const string& message) { |
| 212 | // Use the LogMessage class directly so that the log messages appear to come from |
| 213 | // the line of code which caused the panic, not this code. |
| 214 | #define MY_ERROR google::LogMessage(filepath, line_number, google::GLOG_ERROR).stream() |
| 215 | #define MY_FATAL google::LogMessageFatal(filepath, line_number).stream() |
| 216 | |
| 217 | MY_ERROR << "Panic handling " << call_->ToString() << ": " << message; |
| 218 | MY_ERROR << "Request:\n" << SecureDebugString(*request_pb_); |
| 219 | Trace* t = trace(); |
| 220 | if (t) { |
| 221 | MY_ERROR << "RPC trace:"; |
| 222 | t->Dump(&MY_ERROR, true); |
| 223 | } |
| 224 | MY_FATAL << "Exiting due to panic."; |
| 225 | |
| 226 | #undef MY_ERROR |
| 227 | #undef MY_FATAL |
| 228 | } |
| 229 | |
| 230 | |
| 231 | } // namespace rpc |