diff options
author | tomneedham <tom@owncloud.com> | 2013-11-14 01:14:37 +0000 |
---|---|---|
committer | tomneedham <tom@owncloud.com> | 2013-11-14 01:14:37 +0000 |
commit | ca5c39a3a1ff624a0bbcb39456c93856b8983b51 (patch) | |
tree | 1c66189caeba911092abd98d323cee915da2654d /lib | |
parent | 5a2d7008667242836b00260da73497849f2d6464 (diff) | |
download | nextcloud-server-ca5c39a3a1ff624a0bbcb39456c93856b8983b51.tar.gz nextcloud-server-ca5c39a3a1ff624a0bbcb39456c93856b8983b51.zip |
Return failed shipped responses over succedded shipped responses
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/api.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/api.php b/lib/private/api.php index 76e00958a24..8ff6c3e7eeb 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -159,15 +159,15 @@ class OC_API { } // Remove any error responses if there is one shipped response that succeeded - if(!empty($shipped['succeeded'])) { - $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']); - } else if(!empty($shipped['failed'])) { + if(!empty($shipped['failed'])) { // Which shipped response do we use if they all failed? // They may have failed for different reasons (different status codes) // Which reponse code should we return? // Maybe any that are not OC_API::RESPOND_SERVER_ERROR $response = reset($shipped['failed']); return $response['response']; + } elseif(!empty($shipped['succeeded'])) { + $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']); } elseif(!empty($thirdparty['failed'])) { // Return the third party failure result $response = reset($thirdparty['failed']); |