io.soffa.spring.config.CustomRestExceptionHandler Maven / Gradle / Ivy
package io.soffa.spring.config;
import io.soffa.commons.exceptions.*;
import io.soffa.commons.logging.Logger;
import lombok.AllArgsConstructor;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.server.ResponseStatusException;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
@Order(Ordered.HIGHEST_PRECEDENCE)
@ControllerAdvice
@AllArgsConstructor
class CustomRestExceptionHandler extends ResponseEntityExceptionHandler {
private Environment environment;
private static final Logger logger = Logger.create(CustomRestExceptionHandler.class);
@ExceptionHandler(Throwable.class)
public ResponseEntity
© 2015 - 2024 Weber Informatics LLC | Privacy Policy