Skip to content

Commit

Permalink
Don't fail if ConnectionError has no code (ansible#53455)
Browse files Browse the repository at this point in the history
Fall back to normal error handling instead
  • Loading branch information
Qalthos authored Mar 7, 2019
1 parent e55e8fe commit 72eb867
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ansible/utils/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def handle_request(self, request):
result = rpc_method(*args, **kwargs)
except ConnectionError as exc:
display.vvv(traceback.format_exc())
error = self.error(code=exc.code, message=to_text(exc))
try:
error = self.error(code=exc.code, message=to_text(exc))
except AttributeError:
error = self.internal_error(data=to_text(exc))
response = json.dumps(error)
except Exception as exc:
display.vvv(traceback.format_exc())
Expand Down

0 comments on commit 72eb867

Please sign in to comment.