diff --git a/src/functions/__init__.py b/src/functions/__init__.py index 4349d71..3ea2dae 100644 --- a/src/functions/__init__.py +++ b/src/functions/__init__.py @@ -166,8 +166,8 @@ class Functions: return [return_code, output] except Exception as e: - return [-99, e] Functions.log(source, Functions.ERROR, "%s" % e) + return [-99, e] class Consts: diff --git a/src/tests/test_functions.py b/src/tests/test_functions.py index 728ab80..e31a0ea 100644 --- a/src/tests/test_functions.py +++ b/src/tests/test_functions.py @@ -150,6 +150,7 @@ def test_functions_run_command_not_found(): return_result=False) assert return_code == -99 assert str(result) == "[Errno 2] No such file or directory: 'no_command_here'" - assert len(Functions.debug_log) == 0 + assert len(Functions.debug_log) == 1 + assert re.match("\[EASYHAPROXY\] .* \[ERROR\]: \[Errno 2\] No such file or directory: 'no_command_here'", Functions.debug_log[0]) finally: Functions.debug_log = None