Get a string representation of the exception.
| 82 | |
| 83 | /// Get a string representation of the exception. |
| 84 | virtual const char* what() const throw () |
| 85 | { |
| 86 | #if !defined(ASIO_NO_EXCEPTIONS) |
| 87 | try |
| 88 | #endif // !defined(ASIO_NO_EXCEPTIONS) |
| 89 | { |
| 90 | if (!what_.get()) |
| 91 | { |
| 92 | std::string tmp(context_); |
| 93 | if (tmp.length()) |
| 94 | tmp += ": "; |
| 95 | tmp += code_.message(); |
| 96 | what_.reset(new std::string(tmp)); |
| 97 | } |
| 98 | return what_->c_str(); |
| 99 | } |
| 100 | #if !defined(ASIO_NO_EXCEPTIONS) |
| 101 | catch (std::exception&) |
| 102 | { |
| 103 | return "system_error"; |
| 104 | } |
| 105 | #endif // !defined(ASIO_NO_EXCEPTIONS) |
| 106 | } |
| 107 | |
| 108 | /// Get the error code associated with the exception. |
| 109 | error_code code() const |
no test coverage detected