Package javax.ws.rs.ext

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()


                    }

                    ExceptionMapper mapper = exceptionMappers.findMapping(throwable);
                    if (mapper != null) {
                        try {
                            final Response mappedResponse = mapper.toResponse(throwable);
                            if (mappedResponse != null) {
                                // response successfully mapped
                                return mappedResponse;
                            } else {
                                return Response.noContent().build();
View Full Code Here


       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

                  }
                  if (errorResponse.getEntity() == null)
                  {
                     if (excmap != null)
                     {
                        errorResponse = excmap.toResponse(e);
                     }
                  }
                 
                  if (e.getMessage() != null)
                     errorResponse =
View Full Code Here

                        {
                           // Hide error message if exception mapper exists.
                           LOG.warn("WebApplication exception occurs.", e.getCause());
                        }

                        errorResponse = excmap.toResponse(e);
                     }
                     else
                     {
                        if (e.getCause() != null)
                        {
View Full Code Here

                  if (LOG.isDebugEnabled())
                  {
                     // Hide error message if exception mapper exists.
                     LOG.warn("Internal error occurs.", cause);
                  }
                  response.setResponse(excmap.toResponse(e.getCause()));
               }
               else
               {
                  LOG.error("Internal error occurs.", cause);
                  throw new UnhandledException(e.getCause());
View Full Code Here

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
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.