Examples of ExceptionResponse


Examples of com.cloud.api.response.ExceptionResponse

                    } else {
                        responseName = "errorresponse";
                    }
                }
            }
            ExceptionResponse apiResponse = new ExceptionResponse();
            apiResponse.setErrorCode(errorCode);
            apiResponse.setErrorText(errorText);
            apiResponse.setResponseName(responseName);
            // Also copy over the IdentityProxy object List into this new apiResponse, from
            // the exception caught. When invoked from handle(), the exception here can
            // be either ServerApiException, PermissionDeniedException or InvalidParameterValue
            // Exception. When invoked from ApiServlet's processRequest(), this can be
            // a standard exception like NumberFormatException. We'll leave the standard ones alone.
            if (ex != null) {
              if (ex instanceof ServerApiException || ex instanceof PermissionDeniedException
                  || ex instanceof InvalidParameterValueException) {
                // Cast the exception appropriately and retrieve the IdentityProxy
                if (ex instanceof ServerApiException) {
                  ServerApiException ref = (ServerApiException) ex;
                  ArrayList<IdentityProxy> idList = ref.getIdProxyList();
                  if (idList != null) {
                    for (int i=0; i < idList.size(); i++) {
                      IdentityProxy id = idList.get(i);
                      apiResponse.addProxyObject(id.getTableName(), id.getValue(), id.getidFieldName());
                    }                   
                  }
                  // Also copy over the cserror code and the function/layer in which it was thrown.
                  apiResponse.setCSErrorCode(ref.getCSErrorCode());
                } else if (ex instanceof PermissionDeniedException) {
                  PermissionDeniedException ref = (PermissionDeniedException) ex;
                  ArrayList<IdentityProxy> idList = ref.getIdProxyList();
                  if (idList != null) {
                    for (int i=0; i < idList.size(); i++) {
                      IdentityProxy id = idList.get(i);
                      apiResponse.addProxyObject(id.getTableName(), id.getValue(), id.getidFieldName());
                    }                   
                  }
                  // Also copy over the cserror code and the function/layer in which it was thrown.
                  apiResponse.setCSErrorCode(ref.getCSErrorCode());
                } else if (ex instanceof InvalidParameterValueException) {
                  InvalidParameterValueException ref = (InvalidParameterValueException) ex;
                  ArrayList<IdentityProxy> idList = ref.getIdProxyList();
                  if (idList != null) {
                    for (int i=0; i < idList.size(); i++) {
                      IdentityProxy id = idList.get(i);
                      apiResponse.addProxyObject(id.getTableName(), id.getValue(), id.getidFieldName());
                    }                   
                  }
                  // Also copy over the cserror code and the function/layer in which it was thrown.
                  apiResponse.setCSErrorCode(ref.getCSErrorCode());
                }
              }
            }
            SerializationContext.current().setUuidTranslation(true);
            responseText = ApiResponseSerializer.toSerializedString(apiResponse, responseType);
View Full Code Here

Examples of com.sishuok.es.extra.exception.web.entity.ExceptionResponse

     */
    @ExceptionHandler({UnauthorizedException.class})
    @ResponseStatus(HttpStatus.UNAUTHORIZED)
    public ModelAndView processUnauthenticatedException(NativeWebRequest request, UnauthorizedException e) {
        LogUtils.logError("用户权限验证失败", e);
        ExceptionResponse exceptionResponse = ExceptionResponse.from(e);

        ModelAndView mv = new ModelAndView();
        mv.addObject("error", exceptionResponse);
        mv.setViewName("error/exception");

View Full Code Here

Examples of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ExceptionResponse

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new ExceptionResponse();
    }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.ExceptionResponse

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new ExceptionResponse();
    }
View Full Code Here

Examples of org.apache.activemq.command.ExceptionResponse

    protected void sendSyncToSlave(Command command) {
        try {
            Response response = (Response)slave.request(command);
            if (response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                LOG.error("Slave Failed", er.getException());
            }
        } catch (Throwable e) {
            LOG.error("Slave Failed", e);
        }
    }
View Full Code Here

Examples of org.apache.activemq.command.ExceptionResponse

                            ResponseCallback callback = new ResponseCallback() {
                                public void onCompletion(FutureResponse future) {
                                    try {
                                        Response response = future.getResult();
                                        if (response.isException()) {
                                            ExceptionResponse er = (ExceptionResponse)response;
                                            serviceLocalException(er.getException());
                                        } else {
                                            localBroker.oneway(new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, 1));
                                            dequeueCounter.incrementAndGet();
                                        }
                                    } catch (IOException e) {
View Full Code Here

Examples of org.apache.activemq.command.ExceptionResponse

                                    context.getConnection().dispatchAsync(response);
                                }

                            } catch (Exception e) {
                                if (!sendProducerAck && !context.isInRecoveryMode()) {
                                    ExceptionResponse response = new ExceptionResponse(e);
                                    response.setCorrelationId(message.getCommandId());
                                    context.getConnection().dispatchAsync(response);
                                }
                            }
                        }
                    });
View Full Code Here

Examples of org.apache.activemq.command.ExceptionResponse

        // Copy and Clear the request Map
        ArrayList<FutureResponse> requests = new ArrayList<FutureResponse>(requestMap.values());
        requestMap.clear();
        for (Iterator<FutureResponse> iter = requests.iterator(); iter.hasNext();) {
            FutureResponse fr = iter.next();
            fr.set(new ExceptionResponse(error));
        }
        super.onException(error);
    }
View Full Code Here

Examples of org.apache.activemq.command.ExceptionResponse

        } catch (Throwable e) {
            if (responseRequired) {
                if (SERVICELOG.isDebugEnabled() && e.getClass() != BrokerStoppedException.class) {
                    SERVICELOG.debug("Error occured while processing sync command: " + e, e);
                }
                response = new ExceptionResponse(e);
            } else {
                serviceException(e);
            }
        }
        if (responseRequired) {
View Full Code Here

Examples of org.apache.activemq.command.ExceptionResponse

        } else {

            try {
                Response response = (Response)this.transport.request(command);
                if (response.isException()) {
                    ExceptionResponse er = (ExceptionResponse)response;
                    if (er.getException() instanceof JMSException) {
                        throw (JMSException)er.getException();
                    } else {
                        throw JMSExceptionSupport.create(er.getException());
                    }
                }
                return response;
            } catch (IOException e) {
                throw JMSExceptionSupport.create(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.