assign exception to local variable ex, as expected