From 0661bc0047b405afeeafaa132ffdbe5cf58e814d Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Thu, 2 May 2024 15:55:25 +0530 Subject: [PATCH] fix: no exceptions for delete paths Signed-off-by: Anupam Kumar --- lib/Service/LangRopeService.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/Service/LangRopeService.php b/lib/Service/LangRopeService.php index fe10205..01459a5 100644 --- a/lib/Service/LangRopeService.php +++ b/lib/Service/LangRopeService.php @@ -131,7 +131,6 @@ private function requestToExApp( * @param string $userId * @param string $providerKey * @return void - * @throws RuntimeException */ public function deleteSourcesByProvider(string $userId, string $providerKey): void { $params = [ @@ -139,27 +138,33 @@ public function deleteSourcesByProvider(string $userId, string $providerKey): vo 'providerKey' => $providerKey, ]; - $this->requestToExApp('/deleteSourcesByProvider', 'POST', $params); + try { + $this->requestToExApp('/deleteSourcesByProvider', 'POST', $params); + } catch (RuntimeException $e) { + $this->logger->error('Could not delete sources by provider', ['exception' => $e]); + } } /** * @param string $providerKey * @return void - * @throws RuntimeException */ public function deleteSourcesByProviderForAllUsers(string $providerKey): void { $params = [ 'providerKey' => $providerKey, ]; - $this->requestToExApp('/deleteSourcesByProviderForAllUsers', 'POST', $params); + try { + $this->requestToExApp('/deleteSourcesByProviderForAllUsers', 'POST', $params); + } catch (RuntimeException $e) { + $this->logger->error('Could not delete sources by provider for all users', ['exception' => $e]); + } } /** * @param string $userId * @param string[] $sourceNames * @return void - * @throws RuntimeException */ public function deleteSources(string $userId, array $sourceNames): void { if (count($sourceNames) === 0) { @@ -171,7 +176,11 @@ public function deleteSources(string $userId, array $sourceNames): void { 'sourceNames' => $sourceNames, ]; - $this->requestToExApp('/deleteSources', 'POST', $params); + try { + $this->requestToExApp('/deleteSources', 'POST', $params); + } catch (RuntimeException $e) { + $this->logger->error('Could not delete sources', ['exception' => $e]); + } } /**