mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
fix(ocm): manage 4xx on ocm requests
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
e2eb3bd5f7
commit
4dba1455a6
1 changed files with 3 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ namespace OC\OCM;
|
|||
|
||||
use Exception;
|
||||
use GuzzleHttp\Exception\ConnectException;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use JsonException;
|
||||
use OC\Core\AppInfo\ConfigLexicon;
|
||||
use OC\OCM\Model\OCMProvider;
|
||||
|
|
@ -286,6 +287,7 @@ final class OCMDiscoveryService implements IOCMDiscoveryService {
|
|||
*
|
||||
* @throws OCMCapabilityException if remote does not support $capability
|
||||
* @throws OCMProviderException if remote ocm provider is disabled or invalid data returned
|
||||
* @throws RequestException on network issue or remote returns 4xx and 5xx status code
|
||||
* @throws OCMRequestException on internal issue
|
||||
* @since 33.0.0
|
||||
*/
|
||||
|
|
@ -327,7 +329,7 @@ final class OCMDiscoveryService implements IOCMDiscoveryService {
|
|||
'delete' => $client->delete($uri, $this->prepareOcmPayload($uri, 'delete', $options, $body, $signed)),
|
||||
default => throw new OCMRequestException('unknown method'),
|
||||
};
|
||||
} catch (OCMRequestException $e) {
|
||||
} catch (OCMRequestException|RequestException $e) {
|
||||
throw $e;
|
||||
} catch (Exception $e) {
|
||||
$this->logger->warning('error while requesting remote ocm endpoint', ['exception' => $e]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue