Skip to content

Commit

Permalink
feat: error message improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Dec 8, 2024

Verified

This commit was signed with the committer’s verified signature.
azmeuk Éloi Rivard
1 parent a7c6146 commit c734360
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

[0.1.11] - Unreleased
---------------------

Added
^^^^^
- Slightly improved error messages.

[0.1.10] - 2024-12-02
---------------------

4 changes: 3 additions & 1 deletion scim2_tester/utils.py
Original file line number Diff line number Diff line change
@@ -77,8 +77,10 @@ def wrapped(conf: CheckConfig, *args, **kwargs):
except SCIMClientError as exc:
if conf.raise_exceptions:
raise

reason = f"{exc} {exc.__cause__}" if exc.__cause__ else str(exc)
result = CheckResult(
conf, status=Status.ERROR, reason=str(exc), data=exc.source
conf, status=Status.ERROR, reason=reason, data=exc.source
)

# decorate results
2 changes: 1 addition & 1 deletion tests/test_network.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def test_unreachable_host():

assert all(result.status == Status.ERROR for result in results)
assert all(
result.reason == "Network error happened during request" for result in results
"Network error happened during request" in result.reason for result in results
)


0 comments on commit c734360

Please sign in to comment.