try and error event def