All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.firefang.power.exception.autoconfigure.ExceptionHandlerAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 0.0.6
Show newest version
package io.github.firefang.power.exception.autoconfigure;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.github.firefang.power.exception.handler.GlobalExcptionHandler;
import io.github.firefang.power.web.CommonResponse;

/**
 * 自动配置类,自动配置全局异常处理器
 * 
 * @author xinufo
 *
 */
@Configuration
@ConditionalOnClass(CommonResponse.class)
@ConditionalOnWebApplication(type = Type.SERVLET)
public class ExceptionHandlerAutoConfiguration {

    @Bean
    public GlobalExcptionHandler globalExcptionHandler() {
        return new GlobalExcptionHandler();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy