Refactor handle_command_failures method.
Merge branch 'CHEF-4703' into contributions