Put the code inside of a try{}catch(){} block that catches that exception.