-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fine grained error hanlding #141
Comments
I'd like to see a variation of that that lets you hook up a 'error_handler' for a block/task etc ('notify_error' more or less). Would be especially useful if you could pass args to handlers. And if you could order notify_error by the order the notifies are listed in the block ansible/ansible@devel...alikins:task_events was as close as I got to that. ie, not very far, but the goal was to add specific handler "callbacks"[1] for things like "task_result_conn_fail" event (the code in task_events at the moment only implements a generic "append_results" event callback that adds the task to the queue like normal. In theory, something like a connection error event callback could things like "retry" (requeue the task), or add a event to the queue that will get turned into an error 'notify'. The worker could add any extra (serializeable) context or data it has to the TaskEvent it creates. In the above case, that info could make it's way to a 'error notify' handler for example. Could also implement partial updates this way by having worker emit 'update task events' that get handled. |
@alikins as much as i think such a system can be useful, i think it requires a programmer to understand how to use it. The above is made with the knowledge that it does increase complexity for the play author but tries to keep simplicity and easy auditing in mind so non programmers can still 'read what happens'. |
I would suggest having one additional optional Key |
Bump |
@JonRudolph I had thought of an 'on_fail: summary' function or the like for those cases. |
Proposal: on_error
Author:Brian Coca <@bcoca> IRC: bcoca
Date: 2018-08-88
Motivation
People demand more error handling than just 'task status'.
Problems
Solution proposal
New on_error keyword, that has a set of subkeys to indicate how to handle each type of errors depending on assigned values.
The default behaviour stays as it currently is (TODO: document each case in single spot).
keys
values
Optional
Additional
Once this is working, deprecate
ignore_errors
as it really means 'ignore task failed status' and not 'all errors'. The newon_error: task: ignore
provides the same functionThe text was updated successfully, but these errors were encountered: