wangcaitao-global-exception-handler

spring boot 统一异常处理

License

License

GroupId

GroupId

com.wangcaitao
ArtifactId

ArtifactId

wangcaitao-global-exception-handler
Last Version

Last Version

2.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

wangcaitao-global-exception-handler
spring boot 统一异常处理
Project URL

Project URL

https://github.com/wangcaitao/wangcaitao-global-exception-handler
Project Organization

Project Organization

Pivotal Software, Inc.
Source Code Management

Source Code Management

https://github.com/wangcaitao/wangcaitao-global-exception-handler

Download wangcaitao-global-exception-handler

How to add to project

<!-- https://jarcasting.com/artifacts/com.wangcaitao/wangcaitao-global-exception-handler/ -->
<dependency>
    <groupId>com.wangcaitao</groupId>
    <artifactId>wangcaitao-global-exception-handler</artifactId>
    <version>2.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.wangcaitao/wangcaitao-global-exception-handler/
implementation 'com.wangcaitao:wangcaitao-global-exception-handler:2.1.3'
// https://jarcasting.com/artifacts/com.wangcaitao/wangcaitao-global-exception-handler/
implementation ("com.wangcaitao:wangcaitao-global-exception-handler:2.1.3")
'com.wangcaitao:wangcaitao-global-exception-handler:jar:2.1.3'
<dependency org="com.wangcaitao" name="wangcaitao-global-exception-handler" rev="2.1.3">
  <artifact name="wangcaitao-global-exception-handler" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.wangcaitao', module='wangcaitao-global-exception-handler', version='2.1.3')
)
libraryDependencies += "com.wangcaitao" % "wangcaitao-global-exception-handler" % "2.1.3"
[com.wangcaitao/wangcaitao-global-exception-handler "2.1.3"]

Dependencies

compile (3)

Group / Artifact Type Version
com.wangcaitao : wangcaitao-common jar 2.3.0
org.springframework : spring-webmvc jar
org.hibernate.validator : hibernate-validator jar 6.1.5.Final

provided (2)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 4.0.1
org.projectlombok : lombok jar 1.18.12

Project Modules

There are no modules declared in this project.

wangcaitao-global-exception-handler

spring boot 统一异常处理

使用

  1. 添加依赖

    <dependency>
        <groupId>com.wangcaitao</groupId>
        <artifactId>wangcaitao-global-exception-handler</artifactId>
        <version>2.1.3</version>
    </dependency>
  2. 配置文件

    spring:
      mvc:
        throw-exception-if-no-handler-found: true
      resources:
        add-mappings: false
  3. @SpringBootApplication 修改为 @SpringBootApplication(scanBasePackages = {"com.wangcaitao.global", "com.xxx.xxx"}), com.xxx.xxx 为启动类所在 package

Versions

Version
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0