Skip to content

Commit 49deada

Browse files
committed
fixup! replace 'something went wrong' message with more context
1 parent f91f407 commit 49deada

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tests/api/test_forwarding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class MockUnsuccessfulResponse:
195195
def raise_for_status():
196196
"""Dummy raise_for_status method that is always raising an exception."""
197197

198-
raise RequestError("Something went wrong.")
198+
raise RequestError("Failure during request.")
199199

200200
async def post_fail(*args, **kwargs): # pylint: disable=unused-argument
201201
"""Returns a MockUnsuccessfulResponse instance."""
@@ -209,6 +209,6 @@ async def post_fail(*args, **kwargs): # pylint: disable=unused-argument
209209
with caplog.at_level(logging.ERROR):
210210
asyncio.get_event_loop().run_until_complete(forward_xapi_statements(statements))
211211

212-
assert ["Failed to forward xAPI statements. Something went wrong."] == [
212+
assert ["Failed to forward xAPI statements. Failure during request."] == [
213213
message for source, _, message in caplog.record_tuples if source != "asyncio"
214214
]

tests/backends/database/test_es.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,19 +395,19 @@ def test_backends_database_es_query_statements_with_pit_query_failure(
395395
def mock_open_point_in_time(**_):
396396
"""Mocks the Elasticsearch.open_point_in_time method."""
397397

398-
raise ValueError("Something went wrong")
398+
raise ValueError("ES failure")
399399

400400
database = ESDatabase(hosts=ES_TEST_HOSTS, index=ES_TEST_INDEX)
401401
monkeypatch.setattr(database.client, "open_point_in_time", mock_open_point_in_time)
402402

403403
caplog.set_level(logging.ERROR)
404404

405-
msg = "'Failed to open ElasticSearch point in time', 'Something went wrong'"
405+
msg = "'Failed to open ElasticSearch point in time', 'ES failure'"
406406
with pytest.raises(BackendException, match=msg):
407407
database.query_statements(StatementParameters())
408408

409409
logger_name = "ralph.backends.database.es"
410-
msg = "Failed to open ElasticSearch point in time. Something went wrong"
410+
msg = "Failed to open ElasticSearch point in time. ES failure"
411411
assert caplog.record_tuples == [(logger_name, logging.ERROR, msg)]
412412

413413

0 commit comments

Comments
 (0)