| 41 | const char *JsonRpcException::what() const throw() { return this->whatString.c_str(); } |
| 42 | |
| 43 | void JsonRpcException::setWhatMessage() { |
| 44 | if (this->code != 0) { |
| 45 | std::stringstream ss; |
| 46 | ss << "Exception " << this->code << " : " << this->message; |
| 47 | if (data != Json::nullValue) |
| 48 | ss << ", data: " << data.toStyledString(); |
| 49 | this->whatString = ss.str(); |
| 50 | } else { |
| 51 | this->whatString = this->message; |
| 52 | } |
| 53 | } |