add http-hook on_error on_user_defined_event function