mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-07 20:47:48 +00:00
Initial Commit
This commit is contained in:
31
content/pages/01-reference/python/errors/_snippet.mdx
Normal file
31
content/pages/01-reference/python/errors/_snippet.mdx
Normal file
@@ -0,0 +1,31 @@
|
||||
{/* Start Python Errors */}
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```python
|
||||
import sdk
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = None
|
||||
try:
|
||||
res = s.server.get_server_capabilities()
|
||||
except errors.GetServerCapabilitiesResponseBody as e:
|
||||
print(e) # handle exception
|
||||
raise(e)
|
||||
except errors.SDKError as e:
|
||||
print(e) # handle exception
|
||||
raise(e)
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
|
||||
{/* End Python Errors */}
|
||||
3
content/pages/01-reference/python/errors/errors.mdx
Normal file
3
content/pages/01-reference/python/errors/errors.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
## Errors
|
||||
|
||||
{/* render errors */}
|
||||
Reference in New Issue
Block a user