task: Make repository errors more user-friendly #5410
Labels
group/backend
Issue related to the backend (API Server, Git Agent)
state/need-triage
This issue needs to be triaged
type/task
Body of work related to an epic
Component
API Server / GraphQL
Task Description
After the introduction of Prefect we now catch any raised errors and show them in the logs which can lead to task logs that look like this:
It comes from this section of the code:
https://github.com/opsmill/infrahub/blob/infrahub-v1.1.1/backend/infrahub/git/integrator.py#L176-L201
Instead of raising the error we should check if it's an error from a base exception in Infrahub or the SDK and use the
.message
attribute for the log and only raise an error like this if the error is of a different kind.Previously these raised errors would have been caught by the git-agent (https://github.com/opsmill/infrahub/blob/infrahub-v1.1.1/backend/infrahub/message_bus/operations/__init__.py#L57-L68).
The text was updated successfully, but these errors were encountered: