diff --git a/src/galaxy/api/jsonrpc.py b/src/galaxy/api/jsonrpc.py index be78969..51ecad3 100644 --- a/src/galaxy/api/jsonrpc.py +++ b/src/galaxy/api/jsonrpc.py @@ -360,7 +360,8 @@ class Connection(): @staticmethod def _log_error(response, error, sensitive_params): - data = anonymise_sensitive_params(error.data, sensitive_params) + params = error.data if error.data is not None else {} + data = anonymise_sensitive_params(params, sensitive_params) logger.info("Handling error: id=%s, code=%s, description=%s, data=%s", response.id, error.code, error.message, data ) diff --git a/tests/test_refresh_credentials.py b/tests/test_refresh_credentials.py index 4b5f7c1..1bb3678 100644 --- a/tests/test_refresh_credentials.py +++ b/tests/test_refresh_credentials.py @@ -4,7 +4,7 @@ import asyncio from galaxy.unittest.mock import async_return_value from tests import create_message, get_messages from galaxy.api.errors import ( - BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied + BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied, UnknownError ) from galaxy.api.jsonrpc import JsonRpcError @pytest.mark.asyncio @@ -40,7 +40,7 @@ async def test_refresh_credentials_success(plugin, read, write): @pytest.mark.asyncio @pytest.mark.parametrize("exception", [ - BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied + BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied, UnknownError ]) async def test_refresh_credentials_failure(exception, plugin, read, write):