Added test case for using closure for OnException clause.