diff options
Diffstat (limited to 'src/zenremotestore/projectstore/buildsremoteprojectstore.cpp')
| -rw-r--r-- | src/zenremotestore/projectstore/buildsremoteprojectstore.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/zenremotestore/projectstore/buildsremoteprojectstore.cpp b/src/zenremotestore/projectstore/buildsremoteprojectstore.cpp index 2282a31dd..e95d9118c 100644 --- a/src/zenremotestore/projectstore/buildsremoteprojectstore.cpp +++ b/src/zenremotestore/projectstore/buildsremoteprojectstore.cpp @@ -284,9 +284,7 @@ public: } catch (const HttpClientError& Ex) { - Result.ErrorCode = Ex.GetInternalErrorCode() != 0 ? Ex.GetInternalErrorCode() - : Ex.GetHttpResponseCode() != HttpResponseCode::ImATeapot ? (int)Ex.GetHttpResponseCode() - : 0; + Result.ErrorCode = MakeErrorCode(Ex); Result.Reason = fmt::format("Failed finalizing oplog container build part to {}/{}/{}/{}/{}. Reason: '{}'", m_BuildStorageHttp.GetBaseUri(), m_Namespace, @@ -315,9 +313,7 @@ public: } catch (const HttpClientError& Ex) { - Result.ErrorCode = Ex.GetInternalErrorCode() != 0 ? Ex.GetInternalErrorCode() - : Ex.GetHttpResponseCode() != HttpResponseCode::ImATeapot ? (int)Ex.GetHttpResponseCode() - : 0; + Result.ErrorCode = MakeErrorCode(Ex); Result.Reason = fmt::format("Failed finalizing oplog container build to {}/{}/{}/{}. Reason: '{}'", m_BuildStorageHttp.GetBaseUri(), m_Namespace, @@ -591,8 +587,8 @@ public: private: static int MakeErrorCode(const HttpClientError& Ex) { - return Ex.GetInternalErrorCode() != 0 ? Ex.GetInternalErrorCode() - : Ex.GetHttpResponseCode() != HttpResponseCode::ImATeapot ? (int)Ex.GetHttpResponseCode() + return Ex.GetInternalErrorCode() != HttpClientErrorCode::kOK ? static_cast<int>(Ex.GetInternalErrorCode()) + : Ex.GetHttpResponseCode() != HttpResponseCode::ImATeapot ? static_cast<int>(Ex.GetHttpResponseCode()) : 0; } |