Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F49213221
D293.1773966217.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D293.1773966217.diff
View Options
diff --git a/src/client/actions/auth.cpp b/src/client/actions/auth.cpp
--- a/src/client/actions/auth.cpp
+++ b/src/client/actions/auth.cpp
@@ -158,17 +158,19 @@
ClientResult processResponse(ClientModel m, GetVersionsResponse r)
{
+ if (!r.success()) {
+ return {
+ std::move(m),
+ failWithResponse(r)
+ };
+ }
m.versions = r.versions();
return {
std::move(m),
[r](auto &&ctx) {
- if (r.success()) {
- return EffectStatus(r.success(), json{
- {"versions", r.versions()},
- });
- } else {
- return failWithResponse(r)(std::forward<decltype(ctx)>(ctx));
- }
+ return EffectStatus(r.success(), json{
+ {"versions", r.versions()},
+ });
}
};
}
diff --git a/src/tests/client/get-versions-test.cpp b/src/tests/client/get-versions-test.cpp
--- a/src/tests/client/get-versions-test.cpp
+++ b/src/tests/client/get-versions-test.cpp
@@ -58,5 +58,15 @@
});
}
+ WHEN("Failed response without json body")
+ {
+ auto fileResponse = makeResponse("GetVersions",
+ withResponseStatusCode(403) | withResponseBytesBody(""));
+ store.dispatch(ProcessResponseAction{fileResponse})
+ .then([client](auto stat) {
+ REQUIRE(!stat.success());
+ });
+ }
+
io.run();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 19, 5:23 PM (7 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1210981
Default Alt Text
D293.1773966217.diff (1 KB)
Attached To
Mode
D293: Fix process response without json body for GetVersionsAction
Attached
Detach File
Event Timeline
Log In to Comment