Package org.rstudio.core.client.jsonrpc

Examples of org.rstudio.core.client.jsonrpc.RpcError


      RpcResponse response = RpcResponse.parse(results);
      if (response == null)
         throw new Exception("Unexpected response from server");
     
      // check for errors
      RpcError error = response.getError();
      if (error != null)
      {
         // special error message if we know the user failed to
         // select a directory
         if (error.getCode() == RpcError.PARAM_INVALID &&
             fileUpload_.getFilename().length() == 0)
         {
            throw new Exception("You must specify a file to upload.");
         }
         else
         {
            throw new Exception(error.getEndUserMessage())
         }
      }
     
      // return PendingFileUpload
      PendingFileUpload pendingFileUpload = response.getResult();
View Full Code Here


                  
            // check for error
            if (response.getError() != null)
            {
               // ERROR: explicit error returned by server
               RpcError error = response.getError();

               // if we have a retry handler then see if we can resolve the
               // error and then retry
               if ( resolveRpcErrorAndRetry(error, retryHandler) )
                  return ;
View Full Code Here

               @Override
               public void onResponseReceived(RpcResponse response)
               {
                  if (response.getError() != null)
                  {
                     RpcError error = response.getError();
                     requestCallback.onError(new RemoteServerError(error));
                  }
                  else
                  {
                     T result = response.<T> getResult();
View Full Code Here

            if (response != null)
            {
               logEntry.logResponse(ResponseType.Normal, results);
               
               // check for error
               RpcError rpcError = response.getError();
               if (rpcError != null)
               {
                  if (rpcError.getCode() == RpcError.METHOD_NOT_FOUND)
                  {
                     requestCallback.onResponseReceived(
                                 new Integer(CREDENTIALS_UPDATE_UNSUPPORTED));
                  }
                  else
                  {
                     requestCallback.onError(new RemoteServerError(rpcError));
                  }
               }
               else // must be a valid response
               {
                  Bool authenticated = response.getResult();
                  if (authenticated.getValue())
                  {
                     requestCallback.onResponseReceived(
                                 new Integer(CREDENTIALS_UPDATE_SUCCESS));
                  }
                  else
                  {
                     requestCallback.onResponseReceived(
                                 new Integer(CREDENTIALS_UPDATE_FAILURE));
                  }
               }
            }
            else // error parsing results
           
               logEntry.logResponse(ResponseType.Error, results);
              
               // form message
               String msg = "Error parsing results: " +
                            (results != null ? results : "(null)");
              
               // we don't expect this so debug log to flag our attention
               Debug.log("UPDATE CREDENTIALS: " + msg);
              
               // return the error
               RpcError rpcError = RpcError.create(RpcError.PARSE_ERROR, msg);
               requestCallback.onError(new RemoteServerError(rpcError));
            }
           
            // remove the hidden form (from both last-ditch list and DOM)
            previousUpdateCredentialsForms_.remove(updateCredentialsForm);
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.jsonrpc.RpcError

Copyright © 2018 www.massapicom. 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.