Skip to content

Commit 1f0e037

Browse files
committed
🐛 Update SDSException to use 'text' instead of 'reason' for message handling; adjust tests accordingly
1 parent 4e99e26 commit 1f0e037

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from aiohttp.web import HTTPBadRequest
2-
from servicelib.aiohttp.rest_responses import safe_status_message
32

43

54
class SDSException(HTTPBadRequest): # pylint: disable=too-many-ancestors
65
# NOTE: all these errors will displayed to the user
76
"""Basic exception for errors raised inside the module"""
87

98
def __init__(self, message: str):
10-
super().__init__(reason=safe_status_message(message))
9+
super().__init__(text=message)

services/web/server/tests/unit/isolated/exporter/test_exporter_formatter_archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ async def test_archive_already_exists(tmp_path, project_id):
5151

5252
assert exc_info.type is SDSException
5353
assert (
54-
exc_info.value.args[0]
54+
exc_info.value.text
5555
== f"Cannot archive '{tmp_path}/nested' because '{tmp_path}/nested/sds_{project_id}.zip' already exists"
5656
)

0 commit comments

Comments
 (0)