* Derived class used to represent an error condition returned by the share * interface functions. */
| 196 | * interface functions. |
| 197 | */ |
| 198 | class curl_share_exception : public curl_exception { |
| 199 | public: |
| 200 | /** |
| 201 | * This constructor enables setting a custom error message and the method name where |
| 202 | * the exception has been thrown. |
| 203 | */ |
| 204 | curl_share_exception(const std::string &error, const std::string &method) : |
| 205 | curl_exception(error,method), code(CURLSHE_OK) {} |
| 206 | /** |
| 207 | * The constructor will transform a CURLSHcode error in a proper error message. |
| 208 | */ |
| 209 | curl_share_exception(const CURLSHcode code, const std::string &method) : |
| 210 | curl_exception(curl_share_strerror(code),method), code(code) {} |
| 211 | |
| 212 | /** |
| 213 | * Returns the error code if there is one. Returns CURLE_OK if none has been set. |
| 214 | */ |
| 215 | inline CURLSHcode get_code() const { |
| 216 | return code; |
| 217 | } |
| 218 | private: |
| 219 | CURLSHcode code; |
| 220 | }; |
| 221 | } |
| 222 | |
| 223 | #endif /* defined(CURLCPP_CURL_EXCEPTION_H) */ |
no outgoing calls
no test coverage detected