您的位置:首页 > 编程语言 > Java开发

SpringBoot07 异常枚举、自定义异常、统一的全局异常处理

2018-01-02 17:24 316 查看

1 异常编号和提示信息统一管理

  利用枚举来实现异常的统一管理

  

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package org.springframework.web.bind.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ExceptionHandler {
Class<? extends Throwable>[] value() default {};
}


View Code

4 参考资料

  参考01 参考02 参考03 参考04
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: