AutoClientException Class
Definition
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
Examples
try
{
await _myClient.SendRequest();
}
catch (AutoClientException ex) when (ex.StatusCode == 403)
{
// Handle forbidden scenario
}
Remarks
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.
Constructors
AutoClientException(String, Exception, String, AutoClientHttpError) |
Initializes a new instance of the AutoClientException class. |
AutoClientException(String, String, AutoClientHttpError) |
Initializes a new instance of the AutoClientException class. |
Properties
HttpError |
Gets the HTTP response. |
Path |
Gets the initial path of the HTTP request. |
StatusCode |
Gets the HTTP status code. |