Skip to content

Instantly share code, notes, and snippets.

@ricardolsmendes
Last active April 18, 2021 01:04
Show Gist options
  • Save ricardolsmendes/1a29701f57d102874d38454bcb035545 to your computer and use it in GitHub Desktop.
Save ricardolsmendes/1a29701f57d102874d38454bcb035545 to your computer and use it in GitHub Desktop.
Raising exceptions with Azure Durable Functions in Python
def main(data: Dict[str, Any]) -> Dict[str, Any]:
if not data:
raise Exception('The funds transfer data is mandatory')
if not data.get('sourceAccount'):
raise Exception('The Source Account is mandatory')
if not data.get('targetAccount'):
raise Exception('The Target Account is mandatory')
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment