Examples of ApiException


Examples of org.graylog2.restclient.lib.APIException

    @Test
    public void testGetMessage() throws Exception {
        final Request request = new RequestBuilder()
                .setUrl("http://user:password@localhost:1234/some/path?query=foo#fragment")
                .build();
        final APIException apiException = new APIException(request, (Response) null);

        final String message = apiException.getMessage();
        assertThat(message, not(new Contains(":password")));
        assertThat(message, new Contains("user@"));
    }
View Full Code Here

Examples of org.graylog2.restclient.lib.APIException

    public SearchResult search() throws IOException, APIException {
        SearchResultResponse response = doSearch(SearchResultResponse.class, MediaType.JSON_UTF_8, PER_PAGE, null);
        if (response == null) {
            log.error("We should never get an empty result without throwing an IOException.");
            throw new APIException(null, null, new RuntimeException("Empty search response, this is likely a bug in exception handling."));
        }

        SearchResult result = new SearchResult(
                query,
                response.builtQuery,
View Full Code Here

Examples of org.iplantc.agave.client.ApiException

  }

  public MultipleMetadataResponse listMetadata(String q) throws ApiException {
    // verify required params are set
    if (q == null) {
      throw new ApiException(400, "missing required params");
    }
    // create path and map variables
    String path = "/meta/" + Settings.API_VERSION + "/data".replaceAll("\\{format\\}", "json");

    // query params
View Full Code Here

Examples of org.openmrs.api.APIException

            String startDateFieldName = (ModuleUtil.compareVersion(
                    OpenmrsConstants.OPENMRS_VERSION_SHORT, "1.10") > -1) ? "dateActivated" : "startDate";
            try {
                startDateWidget.setInitialValue(PropertyUtils.getProperty(regDrugOrders.get(0), startDateFieldName));
            } catch (Exception e) {
                throw new APIException(e);
            }
        }
        context.getSchema().addField(srf);
  }
View Full Code Here

Examples of org.springframework.social.ApiException

  }
 
  private void handleExceptionFromFilterChain(Exception e, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException {
    RuntimeException ase = (ApiException) throwableAnalyzer.getFirstThrowableOfType(ApiException.class, throwableAnalyzer.determineCauseChain(e));
    if (ase != null && ase instanceof ApiException) {
      ApiException apiException = (ApiException) ase;
      if (logger.isDebugEnabled()) {
        logger.debug("API Exception: " + e.getMessage());
      }
      if (apiException instanceof NotAuthorizedException || apiException instanceof OperationNotPermittedException) {
        if (logger.isDebugEnabled()) {
          logger.debug("Redirecting for refresh of " + apiException.getProviderId() + " connection.");
        }
        httpResponse.sendRedirect(getRefreshUrl(httpRequest, apiException));
        return;
      }
    }
View Full Code Here

Examples of org.wikipediacleaner.api.APIException

          }
          return true;
        }
      }
    } catch (IOException e) {
      throw new APIException("Error reading Check Wiki configuration: " + e.getMessage());
    }
    return false;
  }
View Full Code Here

Examples of org.wikipediacleaner.api.APIException

      return shouldContinue(
          root, "/api/query-continue/templates",
          properties);
    } catch (JDOMException e) {
      log.error("Error loading templates", e);
      throw new APIException("Error parsing XML", e);
    }
  }
View Full Code Here

Examples of org.wikipediacleaner.api.APIException

      return shouldContinue(
          root, "/api/query-continue/templates",
          properties);
    } catch (JDOMException e) {
      log.error("Error updating disambiguation status", e);
      throw new APIException("Error parsing XML", e);
    }
  }
View Full Code Here

Examples of org.wikipediacleaner.api.APIException

          throws APIException {
    try {
      checkForError(getRoot(properties, ApiRequest.MAX_ATTEMPTS));
    } catch (JDOMParseException e) {
      log.error("Error purging page cache", e);
      throw new APIException("Error parsing XML", e);
    }
  }
View Full Code Here

Examples of org.wikipediacleaner.api.APIException

      return shouldContinue(
          root, "/api/query-continue/pageswithprop",
          properties);
    } catch (JDOMException e) {
      log.error("Error loading protected titles list", e);
      throw new APIException("Error parsing XML", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.