Add tests for onthrow