Package com.structis.fichesst.shared.exception

Examples of com.structis.fichesst.shared.exception.ServiceException


  protected void doUnexpectedFailure(Throwable e) {
    // logger les erreurs
    logger.error("Erreur inattendu", e);

    if( e != null && e.getCause() instanceof ServiceException ) {
      ServiceException serviceException = (ServiceException) e.getCause();

      try {
        getThreadLocalResponse().reset();
      }
      catch( IllegalStateException ex ) {
        throw new RuntimeException("Unable to report failure", serviceException);
      }
      ServletContext servletContext = getServletContext();
      HttpServletResponse response = getThreadLocalResponse();
      try {
        response.setContentType("text/plain");
        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        try {
          response.getOutputStream().write(serviceException.getCode().getBytes());
        }
        catch( IllegalStateException ex ) {
          response.getWriter().write(serviceException.getCode());
        }
      }
      catch( IOException ex ) {
        servletContext.log(
            "respondWithUnexpectedFailure failed while sending the previous failure to the client", ex);
View Full Code Here


  @Override
  protected void doUnexpectedFailure(Throwable e) {
    // logger les erreurs

    if( e != null && e.getCause() instanceof ServiceException ) {
      ServiceException serviceException = (ServiceException) e.getCause();

      try {
        getThreadLocalResponse().reset();
      }
      catch( IllegalStateException ex ) {
        throw new RuntimeException("Unable to report failure", serviceException);
      }
      ServletContext servletContext = getServletContext();
      HttpServletResponse response = getThreadLocalResponse();
      try {
        response.setContentType("text/plain");
        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        try {
          response.getOutputStream().write(serviceException.getCode().getBytes());
        }
        catch( IllegalStateException ex ) {
          response.getWriter().write(serviceException.getCode());
        }
      }
      catch( IOException ex ) {
        servletContext.log(
            "respondWithUnexpectedFailure failed while sending the previous failure to the client", ex);
View Full Code Here

//import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;

public class ExceptionMapper {

  public static ServiceException map(Throwable ex) {
    ServiceException result = null;

    /*
     * Si l'erreur est d�j� sous forme TechnicalException ou Functional Exception On l'aisse passer
     */
    if( ex instanceof TechnicalException || ex instanceof FunctionalException ) {
View Full Code Here

TOP

Related Classes of com.structis.fichesst.shared.exception.ServiceException

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.