Catch and verify exceptions in a single line of code