Adding support to try/catch and tests for this.