Catch exceptions in example file