new error classes

OBSWSConnectionError, OBSWSRequestError added

they subclass OBSWSError

readme updated with new error classes
This commit is contained in:
2023-08-11 02:22:14 +01:00
parent 515fa565d4
commit 976c8f19a8
11 changed files with 73 additions and 55 deletions

View File

@@ -109,7 +109,13 @@ def on_scene_created(data):
### Errors
If a request fails an `OBSWSError` will be raised with a status code.
If a general error occurs an `OBSWSError` will be raised.
If a connection attempt fails or times out an `OBSWSConnectionError` will be raised.
If a request fails an `OBSWSRequestError` will be raised with a status code.
- The request name and code are retrievable through attributes {OBSWSRequestError}.name and {OBSWSRequestError}.code
For a full list of status codes refer to [Codes](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#requeststatus)