code: protected void throwIfErrorResponse(RESTResponse response) {
          if (response.getCode().isError()) {
              String errMsg = response.getBody();
              if (Utils.isEmpty(errMsg)) {
                  errMsg = "Unknown error; response code: " + response.getCode();
              }
              throw new RuntimeException(errMsg);
          }
      }
docs: If the given response shows an error, throw a RuntimeException using its text.