code: protected void handleError(HttpResponse response) throws SmartsheetException {
  
          com.smartsheet.api.models.Error error;
          try {
              error = this.smartsheet.getJsonSerializer().deserialize(
                      com.smartsheet.api.models.Error.class, response.getEntity().getContent());
          } catch (JsonParseException e) {
              throw new SmartsheetException(e);
          } catch (JsonMappingException e) {
              throw new SmartsheetException(e);
          } catch (IOException e) {
              throw new SmartsheetException(e);
          }
  
          ErrorCode code = ErrorCode.getErrorCode(response.getStatusCode());
  
          if (code == null) {
              throw new SmartsheetRestException(error);
          }
  
          try {
              throw code.getException(error);
          } catch (IllegalArgumentException e) {
              throw new SmartsheetException(e);
          } catch (SecurityException e) {
              throw new SmartsheetException(e);
          }
      }
docs: Handles an error HttpResponse (non-200) returned by Smartsheet REST API.
  
  Exceptions:
  SmartsheetRestException : the exception corresponding to the error
  
  @param response the HttpResponse
  @throws SmartsheetException the smartsheet exception