mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4
This commit is contained in:
19
README.md
19
README.md
@@ -316,13 +316,24 @@ var res = await sdk.Plex.GetServerResourcesAsync(
|
||||
<!-- Start Error Handling [errors] -->
|
||||
## Error Handling
|
||||
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKException` exception, which has the following properties:
|
||||
|
||||
| Property | Type | Description |
|
||||
|---------------|-----------------------|-----------------------|
|
||||
| `Message` | *string* | The error message |
|
||||
| `StatusCode` | *int* | The HTTP status code |
|
||||
| `RawResponse` | *HttpResponseMessage* | The raw HTTP response |
|
||||
| `Body` | *string* | The response content |
|
||||
|
||||
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions:
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json |
|
||||
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
|
||||
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
|
||||
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
|
||||
|
||||
### Example
|
||||
|
||||
@@ -359,7 +370,7 @@ catch (Exception ex)
|
||||
// Handle exception data
|
||||
throw;
|
||||
}
|
||||
else if (ex is Models.Errors.SDKException)
|
||||
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
|
||||
{
|
||||
// Handle default exception
|
||||
throw;
|
||||
|
||||
Reference in New Issue
Block a user