Examples of RequestException


Examples of com.gadglet.core.RequestException

    String msg = request.getParameter(Params.MESSAGE.getParamName());
    if (msg == null || msg.isEmpty()) {
      response.addFieldError(Params.MESSAGE.getParamName(),
          FieldErrorTypes.FIELD_IS_EMPTY);
      throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
    }
    // String field is limited to 500 chars...
    if (msg.length() > 499)
      throw new RequestException(ReqErrorTypes.CONTENT_EXCEED_MAX_LENGTH);

 
    int priority = 0;

    try {
      priority = Integer.parseInt(request.getParameter(Params.PRIORITY
          .getParamName()));
    } catch (NumberFormatException e) {
      log.warning(e.getMessage());
      response.addFieldError(Params.PRIORITY.getParamName(),
          FieldErrorTypes.VALUE_NOT_VALID);
      throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
    }



    PersonalNotesAppsData item = new PersonalNotesAppsData(
View Full Code Here

Examples of com.gadglet.core.RequestException

    String discussionText = request.getParameter(Params.DISCUSSION_TEXT.getParamName());
    if (discussionText == null || discussionText.isEmpty()) {
      response.addFieldError(Params.DISCUSSION_TEXT.getParamName(),
          FieldErrorTypes.FIELD_IS_EMPTY);
      throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
    }
   

    DiscussionsList item = new DiscussionsList(discussionText, request);
View Full Code Here

Examples of com.google.gwt.dev.shell.remoteui.MessageTransport.RequestException

      fail("Should not have timed out");
    } catch (ExecutionException e) {
      // This is where we should hit
      assertTrue("Expected: MessageTransport.RequestException, actual:"
          + e.getCause(), e.getCause() instanceof RequestException);
      RequestException re = (RequestException) e.getCause();
      assertEquals(re.getMessage(), "Unable to process the request.");
    } catch (Exception e) {
      fail("Should not have thrown any other exception");
    }

    network.shutdown();
View Full Code Here

Examples of com.google.gwt.http.client.RequestException

    catch (JavaScriptException e) {
            if (xmlHttpRequest != null) {
                xmlHttpRequest.abort();
                xmlHttpRequest = null;
            }
      listener.onError(new RequestException(e.getMessage()), false);
    }
  }
View Full Code Here

Examples of com.google.gwt.http.client.RequestException

        } catch (JavaScriptException ex) {
            if (transportRequest != null) {
                transportRequest.abort();
                transportRequest = null;
            }
            listener.onError(new RequestException(ex.getMessage()), false);
        }
    }
View Full Code Here

Examples of com.google.gwt.http.client.RequestException

        LOG.trace().log("Snapshot response recieved: ", response.getText());
        // Pull the snapshot out of the response object and return it using
        // the provided callback function.
        if (response.getStatusCode() != Response.SC_OK) {
          callback.onFailure(
              new RequestException("Got back status code " + response.getStatusCode()));
        } else if (!response.getHeader("Content-Type").startsWith("application/json")) {
          callback.onFailure(new RuntimeException("Fetch service did not return json"));
        } else {
          WaveViewData waveView;
          try {
View Full Code Here

Examples of com.google.gwt.http.client.RequestException

      if(isLogued()){
        log.info("User is logged");
        return arg0.proceed();
      }else{
        log.warning("Trying to invoke "+arg0.getMethod().getName()+" without logging");
        throw new RequestException("Trying to invoke "+arg0.getMethod().getName()+" without logging");
      }
    }
  }
View Full Code Here

Examples of com.redhat.gss.redhat_support_lib.errors.RequestException

    if (response.getStatus() != 200) {
      LOGGER.debug("Failed : HTTP error code : " + response.getClientResponseStatus()
          .getStatusCode()
          + " - "
          + response.getClientResponseStatus().getReasonPhrase());
      throw new RequestException(response.getClientResponseStatus()
          .getStatusCode()
          + " - "
          + response.getClientResponseStatus().getReasonPhrase());
    }
    return response.getEntity(c);
View Full Code Here

Examples of com.softwarementors.extjs.djn.router.processor.RequestException

    JsonObject[] individualRequests;
    JsonElement root = parser.parse( requestString );
    if( root.isJsonArray() ) {
      JsonArray rootArray = (JsonArray)root;
      if( rootArray.size() == 0 ) {
        RequestException ex = RequestException.forRequestBatchMustHaveAtLeastOneRequest();
        logger.error( ex.getMessage(), ex );
        throw ex;
      }

      individualRequests = new JsonObject[rootArray.size()];
      int i = 0;
      for( JsonElement item : rootArray ) {
        if( !item.isJsonObject()) {
          RequestException ex = RequestException.forRequestBatchItemMustBeAValidJsonObject(i);
          logger.error( ex.getMessage(), ex );
          throw ex;
        }
        individualRequests[i] = (JsonObject)item;
        i++;
      }
    }
    else if( root.isJsonObject() ) {
      individualRequests = new JsonObject[] {(JsonObject)root};
    }
    else {
      RequestException ex = RequestException.forRequestMustBeAValidJsonObjectOrArray();
      logger.error( ex.getMessage(), ex );
      throw ex;
    }

    return individualRequests;
  }
View Full Code Here

Examples of nexj.core.rpc.RequestException

               {
                  receive(createMessage(message), m_channel, context);
               }
               else
               {
                  throw new RequestException("err.rpc.jms.unknownMessage");
               }
            }
         }

         public void err(Throwable t, InvocationContext context) throws Throwable
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.