code: protected void handleExceptionIfNeeded(HttpResponse response) throws GloboDnsException, IOException {
  		int statusCode = response.getStatusCode();
  		if (statusCode/100 == 2) {
  			// 200 family code
  			// Successful return, do nothing
  			return;
  		} else if (statusCode/100 == 4 || statusCode/100 == 5) {
  			// 400 and 500 family codes
  			// Something was wrong, produce an error result
  			String responseAsString = response.parseAsString();
  			if (responseAsString == null || !responseAsString.startsWith("{")) {
  				// Response not well formed!
  				throw new GloboDnsHttpException("Unknown error in GloboDNS: " + responseAsString, statusCode);
  			}
  			
  			GloboDnsRoot<ErrorMessage> responseObj = this.parse(responseAsString, ErrorMessage.class);
  			ErrorMessage errorMsg = responseObj.getFirstObject();
  			if (errorMsg != null && errorMsg.getMsg() != null) {
  				throw new GloboDnsHttpException(errorMsg.getMsg(), statusCode);
  			} else {
  				throw new GloboDnsHttpException(responseAsString, statusCode);
  			}
  		} else {
  			// Unknown error code, return generic exception with description
  			throw new GloboDnsHttpException(response.parseAsString(), statusCode);
  		}
  	}
docs: /*
  Exception treatment for generic calls
  @throws GloboDnsException