AutoClientException Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The exception that's thrown when REST API requests aren't successful.
public ref class AutoClientException : Exception
public class AutoClientException : Exception
type AutoClientException = class
inherit Exception
Public Class AutoClientException
Inherits Exception
- Inheritance
try
{
await _myClient.SendRequest();
}
catch (AutoClientException ex) when (ex.StatusCode == 403)
{
// Handle forbidden scenario
}
This exception is thrown whenever a REST API call returns a non-successful status code. It contains the status code and the HTTP content returned by the dependency, so that the user can handle exceptions accordingly.
Auto |
Initializes a new instance of the AutoClientException class. |
Auto |
Initializes a new instance of the AutoClientException class. |
Http |
Gets the HTTP response. |
Path |
Gets the initial path of the HTTP request. |
Status |
Gets the HTTP status code. |
Продукт | Версії |
---|---|
.NET | 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided) |
Відгук про .NET
.NET – це проект із відкритим кодом. Виберіть посилання, щоб надати відгук: