Skip to content

Commit

Permalink
Prepare for 1.1.2 release, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbalakirev committed Aug 30, 2024
1 parent 6aab9a3 commit 9e94a59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,21 @@ user_service: UserService = sdk.users

### Error handling

The Corbado Python SDK throws exceptions for all errors. The following exceptions are thrown:
The Corbado Python SDK raises exceptions for all errors except those that occur in the session service during token validation (See example below on how to catch those errors). The following exceptions are thrown:

- `ValidationError` for failed validations (client side)
- `ServerException` for server errors (server side)
- `StandardException` for everything else (client side)

'SessionService' returns 'SessionValidationResult' as result of token validation. You can check whether any errors occurred and handle them if needed:

```Python
result: SessionValidationResult = self.session_service.get_and_validate_short_session_value(short_session=token)
if result.error is not None:
print(result.error)
raise result.error
```

If the Backend API returns a HTTP status code other than 200, the Corbado Python SDK throws a `ServerException`. The `ServerException`class provides convenient methods to access all important data:
sdk.users.get(user_id="usr-123456789")

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.1.2

0 comments on commit 9e94a59

Please sign in to comment.