Skip to content

Commit bbc0b79

Browse files
committed
doc: fix README example
1 parent 57a9b13 commit bbc0b79

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Here is an example of usage:
4141
```python
4242
import datetime
4343
from httpx import Client
44-
from scim2_models import Error
44+
from scim2_client import SCIMResponseErrorObject
4545
from scim2_client.engines.httpx import SyncSCIMClient
4646

4747
client = Client(base_url="https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
@@ -66,9 +66,11 @@ assert user.meta.last_modified == datetime.datetime(
6666

6767
# Create resources
6868
user = User(user_name="bjensen@example.com")
69-
response = scim.create(user)
70-
assert isinstance(response, Error)
71-
assert response.detail == "One or more of the attribute values are already in use or are reserved."
69+
try:
70+
scim.create(user)
71+
except SCIMResponseErrorObject as exc:
72+
error = exc.to_error()
73+
assert error.detail == "One or more of the attribute values are already in use or are reserved."
7274
```
7375

7476
scim2-client belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),

0 commit comments

Comments
 (0)