Post/upload files support.

This commit is contained in:
Chunting Gu
2019-03-28 17:23:48 +08:00
parent 18db152419
commit a8e86dec5e
11 changed files with 201 additions and 32 deletions
+7 -5
View File
@@ -31,6 +31,8 @@ const char* DescribeError(Error error) {
return "HTTP error";
case kServerError:
return "Server error";
case kFileIOError:
return "File IO error";
case kXmlError:
return "XML error";
default:
@@ -38,14 +40,14 @@ const char* DescribeError(Error error) {
}
}
Exception::Exception(Error error, bool timeout, const std::string& details)
: error_(error), timeout_(timeout), msg_(DescribeError(error)) {
if (timeout) {
msg_ += " (timeout)";
}
Exception::Exception(Error error, const std::string& details, bool timeout)
: error_(error), msg_(DescribeError(error)), timeout_(timeout) {
if (!details.empty()) {
msg_ += " (" + details + ")";
}
if (timeout) {
msg_ += " (timeout)";
}
}
} // namespace webcc