diff --git a/src/Controller/InfoProviderController.php b/src/Controller/InfoProviderController.php
index 3e8dba3e..f130209c 100644
--- a/src/Controller/InfoProviderController.php
+++ b/src/Controller/InfoProviderController.php
@@ -33,14 +33,18 @@ use App\Services\InfoProviderSystem\ProviderRegistry;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\Parts\PartFormHelper;
use Doctrine\ORM\EntityManagerInterface;
+use Psr\Log\LoggerInterface;
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
+use Symfony\Component\HttpClient\Exception\ClientException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
+use function Symfony\Component\Translation\t;
+
#[Route('/tools/info_providers')]
class InfoProviderController extends AbstractController
{
@@ -64,7 +68,7 @@ class InfoProviderController extends AbstractController
#[Route('/search', name: 'info_providers_search')]
#[Route('/update/{target}', name: 'info_providers_update_part_search')]
- public function search(Request $request, #[MapEntity(id: 'target')] ?Part $update_target): Response
+ public function search(Request $request, #[MapEntity(id: 'target')] ?Part $update_target, LoggerInterface $exceptionLogger): Response
{
$this->denyAccessUnlessGranted('@info_providers.create_parts');
@@ -83,7 +87,14 @@ class InfoProviderController extends AbstractController
$keyword = $form->get('keyword')->getData();
$providers = $form->get('providers')->getData();
- $results = $this->infoRetriever->searchByKeyword(keyword: $keyword, providers: $providers);
+ try {
+ $results = $this->infoRetriever->searchByKeyword(keyword: $keyword, providers: $providers);
+ } catch (ClientException $e) {
+ $this->addFlash('error', t('info_providers.search.error.client_exception'));
+ $this->addFlash('error',$e->getMessage());
+ //Log the exception
+ $exceptionLogger->error('Error during info provider search: ' . $e->getMessage(), ['exception' => $e]);
+ }
}
return $this->render('info_providers/search/part_search.html.twig', [
diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf
index b0dde50e..1bcfd6bc 100644
--- a/translations/messages.en.xlf
+++ b/translations/messages.en.xlf
@@ -11958,118 +11958,124 @@ Please note, that you can not impersonate a disabled user. If you try you will g
-
+ collection_type.new_element.tooltipThis element was newly created and was not persisted to the database yet.
-
+ part.merge.titleMerge part
-
+ part.merge.title.intointo
-
+ part.merge.confirm.title
- Do you really want to merge <b>%other%</b> into <b>%target%</b>?
+ %other% into %target%?]]>
-
+ part.merge.confirm.message
- <b>%other%</b> will be deleted, and the part will be saved with the shown information.
+ %other% will be deleted, and the part will be saved with the shown information.]]>
-
+ part.info.merge_modal.titleMerge parts
-
+ part.info.merge_modal.other_partOther part
-
+ part.info.merge_modal.other_into_thisMerge other part into this one (delete other part, keep this one)
-
+ part.info.merge_modal.this_into_otherMerge this part into other one (delete this part, keep other one)
-
+ part.info.merge_btnMerge part
-
+ part.update_part_from_info_provider.btnUpdate part from info providers
-
+ info_providers.update_part.titleUpdate existing part from info provider
-
+ part.merge.flash.please_reviewData not saved yet. Review the changes and click save to persist the new data.
-
+ user.edit.flash.permissions_fixedPermissions required by other permissions were missing. This was corrected. Please check if the permissions are as you intended.
-
+ permission.legend.dependency_notePlease note that some permission operations depend on each other. If you encounter a warning that missing permissions were corrected and a permission was set to allow again, you have to set the dependent operation to forbid too. The dependents can normally found right of an operation.
-
+ log.part_stock_changed.timestampTimestamp
-
+ part.info.withdraw_modal.timestampAction timestamp
-
+ part.info.withdraw_modal.timestamp.hintThis field allows you to specify the real date, when the stock operation actually was performed, and not just when it was logged. This value is saved in the extra field of the log entry.
-
+ part.info.withdraw_modal.delete_lot_if_emptyDelete this lot, if it becomes empty
+
+
+ info_providers.search.error.client_exception
+ An error occurred while communicating with the information provider. Check the configuration for this provider and refresh the OAuth tokens if possible.
+
+