diff options
| author | Joe Kirchoff <[email protected]> | 2021-12-07 15:39:11 -0800 |
|---|---|---|
| committer | Joe Kirchoff <[email protected]> | 2021-12-07 15:39:11 -0800 |
| commit | b363c5be2eb4fb99b5c2aec2b691e50efdc69412 (patch) | |
| tree | 92f015fe3e46a305b690058fab59d6a44b97446e /zenserver/upstream/upstreamapply.cpp | |
| parent | Merge pull request #33 from EpicGames/make_Materialize_threadsafe (diff) | |
| download | zen-b363c5be2eb4fb99b5c2aec2b691e50efdc69412.tar.xz zen-b363c5be2eb4fb99b5c2aec2b691e50efdc69412.zip | |
Return status_code as ErrorCode from jupiter api if not successful
Diffstat (limited to 'zenserver/upstream/upstreamapply.cpp')
| -rw-r--r-- | zenserver/upstream/upstreamapply.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/zenserver/upstream/upstreamapply.cpp b/zenserver/upstream/upstreamapply.cpp index e6e54428c..05be5f65c 100644 --- a/zenserver/upstream/upstreamapply.cpp +++ b/zenserver/upstream/upstreamapply.cpp @@ -185,12 +185,12 @@ namespace detail { CloudCacheExistsResult ExistsResult = Session.BlobExists(Keys); ElapsedSeconds += ExistsResult.ElapsedSeconds; - if (ExistsResult.ErrorCode != 0) + if (!ExistsResult.Success) { return {.Bytes = Bytes, .ElapsedSeconds = ElapsedSeconds, - .ErrorCode = ExistsResult.ErrorCode, - .Reason = std::move(ExistsResult.Reason)}; + .ErrorCode = ExistsResult.ErrorCode ? ExistsResult.ErrorCode : -1, + .Reason = !ExistsResult.Reason.empty() ? std::move(ExistsResult.Reason) : "Failed to check if blobs exist"}; } // TODO: Batch upload missing blobs @@ -209,8 +209,8 @@ namespace detail { { return {.Bytes = Bytes, .ElapsedSeconds = ElapsedSeconds, - .ErrorCode = Result.ErrorCode, - .Reason = std::move(Result.Reason)}; + .ErrorCode = ExistsResult.ErrorCode ? ExistsResult.ErrorCode : -1, + .Reason = !ExistsResult.Reason.empty() ? std::move(ExistsResult.Reason) : "Failed to put blobs"}; } } @@ -236,12 +236,12 @@ namespace detail { CloudCacheExistsResult ExistsResult = Session.ObjectExists(Keys); ElapsedSeconds += ExistsResult.ElapsedSeconds; - if (ExistsResult.ErrorCode != 0) + if (!ExistsResult.Success) { return {.Bytes = Bytes, .ElapsedSeconds = ElapsedSeconds, - .ErrorCode = ExistsResult.ErrorCode, - .Reason = std::move(ExistsResult.Reason)}; + .ErrorCode = ExistsResult.ErrorCode ? ExistsResult.ErrorCode : -1, + .Reason = !ExistsResult.Reason.empty() ? std::move(ExistsResult.Reason) : "Failed to check if objects exist"}; } // TODO: Batch upload missing objects @@ -260,8 +260,8 @@ namespace detail { { return {.Bytes = Bytes, .ElapsedSeconds = ElapsedSeconds, - .ErrorCode = Result.ErrorCode, - .Reason = std::move(Result.Reason)}; + .ErrorCode = ExistsResult.ErrorCode ? ExistsResult.ErrorCode : -1, + .Reason = !ExistsResult.Reason.empty() ? std::move(ExistsResult.Reason) : "Failed to put objects"}; } } @@ -330,7 +330,7 @@ namespace detail { CloudCacheResult UpdatesResult = Session.GetComputeUpdates(m_ChannelId); Bytes += UpdatesResult.Bytes; ElapsedSeconds += UpdatesResult.ElapsedSeconds; - if (UpdatesResult.ErrorCode != 0) + if (!UpdatesResult.Success) { return {.Error{.ErrorCode = UpdatesResult.ErrorCode, .Reason = std::move(UpdatesResult.Reason)}, .Bytes = Bytes, @@ -509,7 +509,7 @@ namespace detail { CloudCacheResult ObjectResult = Session.GetObject(It.first); Bytes += ObjectTreeResult.Bytes; ElapsedSeconds += ObjectTreeResult.ElapsedSeconds; - if (ObjectTreeResult.ErrorCode != 0) + if (!ObjectTreeResult.Success) { return {.Error{.ErrorCode = ObjectResult.ErrorCode, .Reason = std::move(ObjectResult.Reason)}, .Bytes = Bytes, @@ -533,7 +533,7 @@ namespace detail { CloudCacheResult BlobResult = Session.GetBlob(It.first); Bytes += ObjectTreeResult.Bytes; ElapsedSeconds += ObjectTreeResult.ElapsedSeconds; - if (BlobResult.ErrorCode != 0) + if (!BlobResult.Success) { return {.Error{.ErrorCode = BlobResult.ErrorCode, .Reason = std::move(BlobResult.Reason)}, .Bytes = Bytes, |