mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Don't fail if ConnectionError has no code (#53455)
Fall back to normal error handling instead
This commit is contained in:
@@ -45,7 +45,10 @@ class JsonRpcServer(object):
|
|||||||
result = rpc_method(*args, **kwargs)
|
result = rpc_method(*args, **kwargs)
|
||||||
except ConnectionError as exc:
|
except ConnectionError as exc:
|
||||||
display.vvv(traceback.format_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)
|
response = json.dumps(error)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
display.vvv(traceback.format_exc())
|
display.vvv(traceback.format_exc())
|
||||||
|
|||||||
Reference in New Issue
Block a user