Skip to content

Commit 4dba145

Browse files
committed
fix(ocm): manage 4xx on ocm requests
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent e2eb3bd commit 4dba145

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/private/OCM/OCMDiscoveryService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Exception;
1313
use GuzzleHttp\Exception\ConnectException;
14+
use GuzzleHttp\Exception\RequestException;
1415
use JsonException;
1516
use OC\Core\AppInfo\ConfigLexicon;
1617
use OC\OCM\Model\OCMProvider;
@@ -286,6 +287,7 @@ public function getIncomingSignedRequest(): ?IIncomingSignedRequest {
286287
*
287288
* @throws OCMCapabilityException if remote does not support $capability
288289
* @throws OCMProviderException if remote ocm provider is disabled or invalid data returned
290+
* @throws RequestException on network issue or remote returns 4xx and 5xx status code
289291
* @throws OCMRequestException on internal issue
290292
* @since 33.0.0
291293
*/
@@ -327,7 +329,7 @@ public function requestRemoteOcmEndpoint(
327329
'delete' => $client->delete($uri, $this->prepareOcmPayload($uri, 'delete', $options, $body, $signed)),
328330
default => throw new OCMRequestException('unknown method'),
329331
};
330-
} catch (OCMRequestException $e) {
332+
} catch (OCMRequestException|RequestException $e) {
331333
throw $e;
332334
} catch (Exception $e) {
333335
$this->logger->warning('error while requesting remote ocm endpoint', ['exception' => $e]);

0 commit comments

Comments
 (0)