How to reschedule job if failed with some exit status


i need to restart jobs which has failed due to license error , i have found job exit status is 2 , any suggestion


suppose a job is running but not getting license and when it fail to get license we will identify and rerun job again , is this possible by any chance