Remove two error codes
This commit is contained in:
+4
-2
@@ -1,5 +1,7 @@
|
||||
#include "webcc/common.h"
|
||||
|
||||
#include <codecvt>
|
||||
|
||||
#include "boost/algorithm/string.hpp"
|
||||
#include "boost/filesystem/fstream.hpp"
|
||||
|
||||
@@ -215,8 +217,8 @@ FormPart::FormPart(const std::string& name, const Path& path,
|
||||
}
|
||||
|
||||
// Determine file name from file path.
|
||||
// TODO: Encoding
|
||||
file_name_ = path.filename().string();
|
||||
// TODO: encoding
|
||||
file_name_ = path.filename().string(std::codecvt_utf8<wchar_t>());
|
||||
|
||||
// Determine content type from file extension.
|
||||
if (mime_type_.empty()) {
|
||||
|
||||
+2
-2
@@ -156,8 +156,8 @@ class FormPart {
|
||||
public:
|
||||
FormPart() = default;
|
||||
|
||||
explicit FormPart(const std::string& name, const Path& path,
|
||||
const std::string& mime_type = "");
|
||||
FormPart(const std::string& name, const Path& path,
|
||||
const std::string& mime_type = "");
|
||||
|
||||
FormPart(const std::string& name, std::string&& data,
|
||||
const std::string& mime_type = "");
|
||||
|
||||
@@ -72,12 +72,8 @@ const char* DescribeError(Error error) {
|
||||
return "Socket write error";
|
||||
case kHttpError:
|
||||
return "HTTP error";
|
||||
case kServerError:
|
||||
return "Server error";
|
||||
case kFileIOError:
|
||||
return "File IO error";
|
||||
case kXmlError:
|
||||
return "XML error";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
+1
-8
@@ -164,7 +164,7 @@ const std::string& UserAgent();
|
||||
enum Error {
|
||||
kNoError = 0, // i.e., OK
|
||||
|
||||
kSchemaError,
|
||||
kSchemaError, // TODO
|
||||
|
||||
kHostResolveError,
|
||||
kEndpointConnectError,
|
||||
@@ -176,15 +176,8 @@ enum Error {
|
||||
// E.g., failed to parse HTTP response (invalid content length, etc.).
|
||||
kHttpError,
|
||||
|
||||
// Server error.
|
||||
// E.g., HTTP status 500 + SOAP Fault element.
|
||||
kServerError,
|
||||
|
||||
// File read/write error.
|
||||
kFileIOError,
|
||||
|
||||
// XML parsing error.
|
||||
kXmlError,
|
||||
};
|
||||
|
||||
// Return a descriptive message for the given error code.
|
||||
|
||||
Reference in New Issue
Block a user