Skip to content
Snippets Groups Projects
Commit ca5c39a3 authored by Tom Needham's avatar Tom Needham
Browse files

Return failed shipped responses over succedded shipped responses

parent 5a2d7008
Branches
No related tags found
No related merge requests found
...@@ -159,15 +159,15 @@ class OC_API { ...@@ -159,15 +159,15 @@ class OC_API {
} }
// Remove any error responses if there is one shipped response that succeeded // Remove any error responses if there is one shipped response that succeeded
if(!empty($shipped['succeeded'])) { if(!empty($shipped['failed'])) {
$responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
} else if(!empty($shipped['failed'])) {
// Which shipped response do we use if they all failed? // Which shipped response do we use if they all failed?
// They may have failed for different reasons (different status codes) // They may have failed for different reasons (different status codes)
// Which reponse code should we return? // Which reponse code should we return?
// Maybe any that are not OC_API::RESPOND_SERVER_ERROR // Maybe any that are not OC_API::RESPOND_SERVER_ERROR
$response = reset($shipped['failed']); $response = reset($shipped['failed']);
return $response['response']; return $response['response'];
} elseif(!empty($shipped['succeeded'])) {
$responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
} elseif(!empty($thirdparty['failed'])) { } elseif(!empty($thirdparty['failed'])) {
// Return the third party failure result // Return the third party failure result
$response = reset($thirdparty['failed']); $response = reset($thirdparty['failed']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment