How to make the job fail via code after handling exception

kjoth
Contributor II

Hi , We are capturing the exception if an error occurs using try except. But we want the job status to be failed once we got the exception. Whats the best way to do that.

We are using pyspark.