Change catch statement to handle all exception types.