public class IotHubExceptionManager extends Object
| Constructor and Description |
|---|
IotHubExceptionManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
httpResponseVerification(HttpResponse httpResponse)
Verify Http response using response status
|
static IotHubException |
mapException(int responseStatus,
String description)
Return a new exception instance that best matches the given HTTP status code and description
|
public static void httpResponseVerification(HttpResponse httpResponse) throws IotHubBadFormatException, IotHubUnauthorizedException, IotHubTooManyDevicesException, IotHubPreconditionFailedException, IotHubTooManyRequestsException, IotHubInternalServerErrorException, IotHubServerBusyException, IotHubBadGatewayException, IotHubNotFoundException, IotHubGatewayTimeoutException, IotHubException
httpResponse - Http response object to verifyIotHubBadFormatException - This exception is thrown if the response status equal 400IotHubUnauthorizedException - This exception is thrown if the response status equal 401IotHubTooManyDevicesException - This exception is thrown if the response status equal 403IotHubNotFoundException - This exception is thrown if the response status equal 404IotHubPreconditionFailedException - This exception is thrown if the response status equal 412IotHubTooManyRequestsException - This exception is thrown if the response status equal 429IotHubInternalServerErrorException - This exception is thrown if the response status equal 500IotHubBadGatewayException - This exception is thrown if the response status equal 502IotHubServerBusyException - This exception is thrown if the response status equal 503IotHubGatewayTimeoutException - This exception is thrown if the response status equal 504IotHubException - This exception is thrown if the response status none of them above and greater then 300public static IotHubException mapException(int responseStatus, String description)
responseStatus - The HTTP status code (404, 500, etc.)description - The HTTP response bodyCopyright © 2024. All rights reserved.