Skip to content

Commit 49da4d4

Browse files
committed
GPI-1341 Fix logging error on _handle_response
1 parent 9745dcd commit 49da4d4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/galaxy/api/jsonrpc.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ def _log_response(response, sensitive_params):
360360

361361
@staticmethod
362362
def _log_error(response, error, sensitive_params):
363-
data = anonymise_sensitive_params(error.data, sensitive_params)
363+
params = error.data if error.data is not None else {}
364+
data = anonymise_sensitive_params(params, sensitive_params)
364365
logger.info("Handling error: id=%s, code=%s, description=%s, data=%s",
365366
response.id, error.code, error.message, data
366367
)

tests/test_refresh_credentials.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from galaxy.unittest.mock import async_return_value
55
from tests import create_message, get_messages
66
from galaxy.api.errors import (
7-
BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied
7+
BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied, UnknownError
88
)
99
from galaxy.api.jsonrpc import JsonRpcError
1010
@pytest.mark.asyncio
@@ -40,7 +40,7 @@ async def test_refresh_credentials_success(plugin, read, write):
4040

4141
@pytest.mark.asyncio
4242
@pytest.mark.parametrize("exception", [
43-
BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied
43+
BackendNotAvailable, BackendTimeout, BackendError, InvalidCredentials, NetworkError, AccessDenied, UnknownError
4444
])
4545
async def test_refresh_credentials_failure(exception, plugin, read, write):
4646

0 commit comments

Comments
 (0)