13#include <unordered_map>
22CLOUD_AUDIOCOM_API CloudSyncError
27 const auto error = response.
getError();
29 if (error == NetworkError::NoError)
34 if (error != NetworkError::HTTPError)
36 result.
Type = error == NetworkError::OperationCancelled ?
47 static const std::unordered_map<int, CloudSyncError::ErrorType> errors {
62 const auto it = errors.find(statusCode);
66 result.
ErrorMessage = std::string(
"HTTP ") + std::to_string(statusCode) +
67 std::string(
"\n") + response.
readAll<std::string>();
Declare functions to perform UTF-8 to std::wstring conversions.
Declare an interface for HTTP response.
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
Interface, that provides access to the data from the HTTP response.
virtual std::string getErrorString() const =0
virtual unsigned getHTTPCode() const noexcept=0
virtual NetworkError getError() const noexcept=0
CloudSyncError::ErrorType DeduceError(SyncResultCode code)
CloudSyncError MakeClientFailure(const TranslatableString &message)
CLOUD_AUDIOCOM_API CloudSyncError DeduceUploadError(audacity::network_manager::IResponse &response)
@ HTTPVersionNotSupported
@ NetworkAuthenticationRequired
std::string ToUTF8(const std::wstring &wstr)
@ ProjectStorageLimitReached