Azure / azure-functions-durable-python

Python library for using the Durable Functions bindings.
MIT License
134 stars 54 forks source link

Handling custom exception type from activities #229

Open Utahjezz opened 3 years ago

Utahjezz commented 3 years ago

I would like to understand if it is possible to handle custom exception type (from activities) inside the orchestrator function.

E.g.:

Activity

raise MyException(custom_data={...})

Orchestrator:

try:
  res = yield context.call_activity("Activity", data)
except MyException as me:
  print(me.custom_data)

The actual behaviour is that in the orchestrator function I only get the generic Exception type and I cannot differentiate the handle logic based on custom_data.

davidmrdavid commented 3 years ago

Hi @Utahjezz ,

Thanks for reaching out. My understanding too is that we're only supporting a limited set of Exception types. So yes, we're not supporting this use case yet. However, adding support for custom exceptions should be possible with relative ease so we should be working on it soon 😄 .

We're currently preparing the final bits for our GA release. Afterwards, I'll be doing a pass over the existing P2 tickets in this repo and prioritizing them for the immediate release after that!

âš¡ âš¡