The error codes you said you wanted to trap are different to those in your code - I just gave example but the error code i want to trap are ORA-04061 , ORA-04068 and ORA-06512.
What do you do if there's an ORA code that's not in your list? - my intension is to try to load in three iterations else leave it so that i will move the file to bad_files directory, its just a try to call package atleast for three times.These are the only error codes we are expecting.
I would change the structure of the program to loop until the error code is empty and then have a trap inside the loop to see if min_loop_count > 3 which will log the error - my intension is if the error code is found then to call the package again and process the file for atleast three times and as per our experience it will load the data to tables and the package gets validated else it will move to bad files directory