org.babyfish.jimmer.spring.client.CodeBasedExceptionAdvice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-spring-boot-starter Show documentation
Show all versions of jimmer-spring-boot-starter Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.spring.client;
import org.babyfish.jimmer.error.CodeBasedException;
import org.babyfish.jimmer.error.CodeBasedRuntimeException;
import org.babyfish.jimmer.spring.cfg.JimmerProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import java.util.*;
@ControllerAdvice
public class CodeBasedExceptionAdvice {
private static final Logger LOGGER = LoggerFactory.getLogger(CodeBasedExceptionAdvice.class);
protected final JimmerProperties.ErrorTranslator errorTranslator;
public CodeBasedExceptionAdvice(JimmerProperties properties) {
this.errorTranslator = properties.getErrorTranslator();
if (errorTranslator.isDebugInfoSupported()) {
notice();
}
}
@ExceptionHandler
public ResponseEntity