Examples of BadRequestException


Examples of com.dottydingo.hyperion.exception.BadRequestException

        {
            EntityPlugin<C,?,ID> plugin = getEntityPlugin(entity);
            checkMethodAllowed(plugin,HttpMethod.GET);

            if(start != null && start < 1)
                throw new BadRequestException("The start parameter must be greater than zero.");

            if(limit != null && limit < 1)
                throw new BadRequestException("The limit parameter must be greater than zero.");

            endpointAuthorizationChecker.checkAuthorization(requestContext);

            ApiVersionPlugin<C, ? extends PersistentObject> versionPlugin =
                    plugin.getApiVersionRegistry().getPluginForVersion(version);
View Full Code Here

Examples of com.elasticinbox.rest.BadRequestException

    Mailbox mailbox = new Mailbox(user, domain);

    try {
      labelDAO.delete(mailbox, labelId);
    } catch (IllegalLabelException ile) {
      throw new BadRequestException(ile.getMessage());
    } catch (Exception e) {
      logger.error("Deleting label failed", e);
      throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
    }
View Full Code Here

Examples of com.google.walkaround.util.server.servlet.BadRequestException

    String code = requireParameter(req, "code");
    String state = requireParameter(req, "state");
    log.info("code=" + code + ", state=" + state);
    String[] split = state.split(" ");
    if (split.length != 2) {
      throw new BadRequestException("state格式错误: " + state);
    }
    OAuthCredentials credentials;
    try {
      credentials = oAuthProviderHelp.exchangeCodeForToken(split[0], code);
    } catch (IOException e) {
View Full Code Here

Examples of com.jdroid.javaweb.api.BadRequestException

   *      javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void noHandlerFound(HttpServletRequest request, HttpServletResponse response) throws Exception {
    String requestUri = new UrlPathHelper().getRequestUri(request);
    throw new BadRequestException("No mapping found for HTTP request", requestUri, request.getParameterMap(),
        request.getMethod(), getServletName());
  }
View Full Code Here

Examples of com.netflix.astyanax.connectionpool.exceptions.BadRequestException

   
    keyspace = context.getClient();

    //for some reason, the keyspace is not always created fast enough so sleep 3 seconds and try again
    KeyspaceDefinition keySpaceMeta = null;
    BadRequestException holdExc = null;
    for(int i = 0; i < 3; i++) {
      try {
        keySpaceMeta = keyspace.describeKeyspace();
      } catch(BadRequestException e) {
        if(e.getMessage().contains(keyspaceName)) {
View Full Code Here

Examples of com.openshift.internal.client.httpclient.BadRequestException

  @Test
  public void shouldThrowWithTextAndExistCode() throws Throwable {
      // pre-conditions
    try {
      mockDirector.mockDeleteDomain("foobarz",
              new BadRequestException(
                  DELETE_DOMAINS_FOOBARZ_KO_EXISTINGAPPS.getContentAsString(),
                  new IOException(
                      "IOException message: Server returned HTTP response code: 400 for URL: https://openshift.redhat.com/broker/rest/domains/foobarz")));
      IDomain domain = user.getDefaultDomain();
      // operation
View Full Code Here

Examples of com.pugh.sockso.web.BadRequestException

     */
   
    public static void checkFeatureEnabled( final Properties p, final String property ) throws BadRequestException {

        if ( !isFeatureEnabled(p,property) )
            throw new BadRequestException( "feature not enabled", 403 );

    }
View Full Code Here

Examples of com.sequenceiq.cloudbreak.controller.BadRequestException

            X509Certificate x509Certificate = (X509Certificate) cf.generateCertificate(is);
        } catch (Exception e) {
            String errorMessage = String.format("Could not validate publickey certificate [credential: '%s', certificate: '%s'], detailed message: %s",
                    azureCredential.getId(), azureCredential.getPublicKey(), e.getMessage());
            LOGGER.error(errorMessage, e);
            throw new BadRequestException(errorMessage, e);
        }
    }
View Full Code Here

Examples of dk.brics.jwig.BadRequestException

  public synchronized void sessionRefreshed(dk.brics.jwig.Session s) {
        if (s instanceof DBSession) {
            DBContext dbContext = sessionContextMap.get(s);
            if (dbContext == null) {
                log.warn("dbContext is null for session " + s.getID() + " with timeout " + new Date(s.getTimeout()), new Exception());
                throw new BadRequestException("Session timeout");
            }
            threadContextMap.remove(dbContext.getActiveThread());
            Thread activeThread = Thread.currentThread();
            dbContext.setActiveThread(activeThread);
            threadContextMap.put(activeThread, dbContext);
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.exceptions.BadRequestException

    Comment newComment = gson.fromJson(content, Comment.class);
   
    List<ValidationIssue> issues = validator.validate(s, newComment);
    if(issues.size() > 0) {
      // TODO: pass errors to client through exception
      throw new BadRequestException();
    }
   
    Defect defect = validator.getLastExistingDefect();
    defect.getEvents().add(newComment);
    db.save(defect, s.getProject());
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.