Package org.camunda.bpm.engine.rest.dto

Examples of org.camunda.bpm.engine.rest.dto.ExceptionDto


@Provider
public class JsonMappingExceptionHandler implements ExceptionMapper<JsonMappingException> {

  @Override
  public Response toResponse(JsonMappingException exception) {
    ExceptionDto dto = ExceptionDto.fromException(exception);
    return Response.status(Status.BAD_REQUEST).entity(dto).type(MediaType.APPLICATION_JSON_TYPE).build();
  }
View Full Code Here


        .type(MediaType.APPLICATION_JSON_TYPE)
        .build();
     
    } else {
     
      ExceptionDto exceptionDto = ExceptionDto.fromException(exception);
     
      return Response
        .serverError()
        .entity(exceptionDto)
        .type(MediaType.APPLICATION_JSON_TYPE)
View Full Code Here

  private static final Logger LOGGER = Logger.getLogger(ExceptionHandler.class.getSimpleName());

  @Override
  public Response toResponse(RestException exception) {
    ExceptionDto dto = ExceptionDto.fromException(exception);

    LOGGER.log(Level.WARNING, getStackTrace(exception));
   
    if (exception.getStatus() != null) {
      return Response.status(exception.getStatus()).entity(dto).type(MediaType.APPLICATION_JSON_TYPE).build();
View Full Code Here

  private static final Logger LOGGER = Logger.getLogger(ExceptionHandler.class.getSimpleName());

  @Override
  public Response toResponse(Exception exception) {
    ExceptionDto dto = ExceptionDto.fromException(exception);

    LOGGER.log(Level.WARNING, getStackTrace(exception));
   
    return Response.serverError().entity(dto).type(MediaType.APPLICATION_JSON_TYPE).build();
  }
View Full Code Here

@Provider
public class JsonParseExceptionHandler implements ExceptionMapper<JsonParseException> {

  @Override
  public Response toResponse(JsonParseException exception) {
    ExceptionDto dto = ExceptionDto.fromException(exception);
    return Response.status(Status.BAD_REQUEST).entity(dto).type(MediaType.APPLICATION_JSON_TYPE).build();
  }
View Full Code Here

    String engineName = extractEngineName(requestUrl);
    ProcessEngine engine = getAddressedEngine(engineName);

    if (engine == null) {
      resp.setStatus(Status.NOT_FOUND.getStatusCode());
      ExceptionDto exceptionDto = new ExceptionDto();
      exceptionDto.setType(InvalidRequestException.class.getSimpleName());
      exceptionDto.setMessage("Process engine " + engineName + " not available");
      ObjectMapper objectMapper = new ObjectMapper();

      resp.setContentType(MediaType.APPLICATION_JSON);
      objectMapper.writer().writeValue(resp.getWriter(), exceptionDto);
      resp.getWriter().flush();
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.rest.dto.ExceptionDto

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.