How treat errors in tasks

Hi,

I have the function that creates a database and after creating the DB I inserted the access information in a VAULT, the problem that sometimes inconsistent information is passed and the database creation TASK returns an error.

I would like to know if when I have an error before canceling the execution I call another task or via callback call a previous task?

I would register the result of that task and use that to decide what to do next.
Also use failed_when later to override what is really a failure.