Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error message context to failure #1231

Open
StephenOTT opened this issue Oct 31, 2024 · 1 comment
Open

Add error message context to failure #1231

StephenOTT opened this issue Oct 31, 2024 · 1 comment

Comments

@StephenOTT
Copy link

When a job/task fails the logs contain what happened, but often you want to add a error message/explanation as part of the log

Is there a way to do this?

At first glance it would seem a json col in the events table would work and allow submitting "context" info as part of the job attempt/fail

Thanks

@onlyann
Copy link
Contributor

onlyann commented Nov 3, 2024

https://procrastinate.readthedocs.io/en/stable/howto/production/logging.html#make-the-most-out-of-the-logging-system

Does the above section help?

In the case of a failed job, there would be an exc_info atttribute in the extra field that holds the caught exception.

Another way is to define a middleware and catch/re-raise exceptions there.

At first glance it would seem a json col in the events table would work and allow submitting "context" info as part of the job attempt/fail

I can see how it would be useful to have error context persisted for failed job events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants