Catch the right kind of exception