Skip to content

Commit c734360

Browse files
committed
feat: error message improvement
1 parent a7c6146 commit c734360

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

doc/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
[0.1.11] - Unreleased
5+
---------------------
6+
7+
Added
8+
^^^^^
9+
- Slightly improved error messages.
10+
411
[0.1.10] - 2024-12-02
512
---------------------
613

scim2_tester/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ def wrapped(conf: CheckConfig, *args, **kwargs):
7777
except SCIMClientError as exc:
7878
if conf.raise_exceptions:
7979
raise
80+
81+
reason = f"{exc} {exc.__cause__}" if exc.__cause__ else str(exc)
8082
result = CheckResult(
81-
conf, status=Status.ERROR, reason=str(exc), data=exc.source
83+
conf, status=Status.ERROR, reason=reason, data=exc.source
8284
)
8385

8486
# decorate results

tests/test_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_unreachable_host():
2222

2323
assert all(result.status == Status.ERROR for result in results)
2424
assert all(
25-
result.reason == "Network error happened during request" for result in results
25+
"Network error happened during request" in result.reason for result in results
2626
)
2727

2828

0 commit comments

Comments
 (0)