Catching exceptions in attempt