You're right. There is no way to use an if statement for those types of errors. But for what you described in your original post
The first one will be if a character is entered instead of a number i want it to display an error message and keep the program running. (Format error)
The second one is if an object is not part of an array, i want it to display an error message and keep the program running.
it seems that you could just use if statements. Check to see if the object is in an array. If it isn't print something out. Or check to see if a variable is a char. If it isn't print something out.
I didn't know that you had specific exceptions that were being thrown. Sorry.