Hey all! We've recently been having issues with th...
# ask-community
s
Hey all! We've recently been having issues with the callback handlers being unable to handle exceptions. We have a task which tries to download data from a URL, and sometimes we get a 503 because the endpoint is flaky. This raises a HTTP error, which should be caught via our
on_failure=[error_cb]
parameter. I swear this used to work just fine, but recently the deserialisation of the task result data is failing to deserialise the exception, so instead of our slack notifaction being a nice "endpoint raised a 503" we get that flow has crashed (because the callback crashed). Screenshot of this stack attached. Does anyone know if something has changed with the callback handlers, or if they no longer support exceptions being raised in the task? Initially we were just reraising the httpx HttpStatusError, and then when that failed we tried to raise a custom HttpError that was defined locally. I'm testing if things will work if we just convert everything to ValueError, but that's not ideal
b
Hey Samuel! Could you share your
prefect version
and maybe a MRE of the code? 👀 I'm interested in seeing how you're raising the
HttpStatusError
and how the
on_failure
hook is defined. Did you notice the hook start to error out after upgrading to a particular version of Prefect?
s
Hi Bianca, I'll see if I can get a MRE running locally for you and throw all the prefect version details in as well