public static void throwExceptionOnError ( ResponseEntity < ? > response ) { if ( ! response . getStatusCode ( ) . equals ( HttpStatus . OK ) ) { throw new CredHubException ( response . getStatusCode ( ) ) ; } }
Helper method to throw an appropriate exception if a request to CredHub returns with an error code .