Repository navigation
chore: guard metadata collection service to not fail the context_chat outputs - #266
Conversation
07549bb to
f30f7d6
Compare
… outputs Signed-off-by: kyteinsky <kyteinsky@gmail.com>
Signed-off-by: kyteinsky <kyteinsky@gmail.com>
f30f7d6 to
8a79716
Compare
| continue; | ||
| } catch (InvalidArgumentException $e) { | ||
| $this->logger->warning('Could not extract item id from the source id', ['source_id' => $source['source_id'], 'exception' => $e]); | ||
| continue; |
There was a problem hiding this comment.
Would perhaps be even better to simply catch \Throwable here, as loading the provider class can fail in unexpected ways (who knows what people do in their apps)
There was a problem hiding this comment.
hehe, fair enough, that is already implemented in the lines below where $url = $klass->getItemUrl($itemId); their function is called. In this try block, it's only our and server code so should be good.
There was a problem hiding this comment.
Actually, Server::get($providerConfig['classString']) loads third party php files, no? If those throw an error that is not ContainerException, NotFoundExceptionInterface or InvalidArgumentException, then this whole method throws.
| continue; | ||
| } catch (InvalidArgumentException $e) { | ||
| $this->logger->warning('Could not extract item id from the source id', ['source_id' => $source['source_id'], 'exception' => $e]); | ||
| continue; |
There was a problem hiding this comment.
Actually, Server::get($providerConfig['classString']) loads third party php files, no? If those throw an error that is not ContainerException, NotFoundExceptionInterface or InvalidArgumentException, then this whole method throws.
🤖 AI (if applicable)