Edthehead
Contributor III

What you can do is pass the custom error message you want from the notebook back to the workflow 

output = f"There was an error with {error_code} : {error_msg}"
dbutils.notebook.exit(output)
 
Then when you are fetching the status of your pipeline, you can also check the output of each task. You need to loop through each task runid to get the individual outputs. You would use jobs/runs/get-output with run_id as a parameter. The run_id should be that of the task and not the job itself. Based on the output of the task, your pipeline can understand the custom error. You will find the output in a json variable called 
notebook_output.

View solution in original post