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