diff --git a/src/automate/callables/builtin_callables.py b/src/automate/callables/builtin_callables.py index 612750b..97654c6 100644 --- a/src/automate/callables/builtin_callables.py +++ b/src/automate/callables/builtin_callables.py @@ -25,9 +25,13 @@ from builtins import bytes import datetime + from future import standard_library + standard_library.install_aliases() +from http.client import HTTPException + import re import threading import xmlrpc.client @@ -1082,6 +1086,7 @@ def call(self, caller=None, **kwargs): return '' + class RemoteFunc(AbstractCallable): """ @@ -1106,9 +1111,9 @@ def call(self, caller, **kwargs): _kwargs = {k: self.call_eval(v, caller, **kwargs) for k, v in list(self._kwargs.items())} try: return getattr(server, funcname)(*args, **_kwargs) - except xmlrpc.client.Fault as e: - self.logger.error( - 'Could call remote function (%s,%s)(*%s, **%s), error: %s', server, funcname, args, _kwargs, e) + except (xmlrpc.client.Fault, HTTPException) as e: + self.logger.exception( + 'Exception occurred in remote function call (%s,%s)(*%s, **%s), error: %s', server, funcname, args, _kwargs, e) except (socket.gaierror, IOError, xmlrpc.client.Fault) as e: self.logger.error('Could call remote function, error: %s', e)