Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
fcfa6610
提交
fcfa6610
authored
6月 25, 2022
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
暂时移除 mall-spring-boot-starter-sentry 的封装
上级
3012ff84
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
0 行增加
和
100 行删除
+0
-100
pom.xml
归档/common/mall-spring-boot-starter-sentry/pom.xml
+0
-26
CustomSentryAutoConfiguration.java
...der/mall/sentry/config/CustomSentryAutoConfiguration.java
+0
-39
DoNothingExceptionResolver.java
...oder/mall/sentry/resolver/DoNothingExceptionResolver.java
+0
-33
spring.factories
...arter-sentry/src/main/resources/META-INF/spring.factories
+0
-2
没有找到文件。
归档/common/mall-spring-boot-starter-sentry/pom.xml
deleted
100644 → 0
浏览文件 @
3012ff84
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
common
</artifactId>
<groupId>
cn.iocoder.mall
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
mall-spring-boot-starter-sentry
</artifactId>
<dependencies>
<dependency>
<groupId>
io.sentry
</groupId>
<artifactId>
sentry-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
io.sentry
</groupId>
<artifactId>
sentry-logback
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
归档/common/mall-spring-boot-starter-sentry/src/main/java/cn/iocoder/mall/sentry/config/CustomSentryAutoConfiguration.java
deleted
100644 → 0
浏览文件 @
3012ff84
package
cn
.
iocoder
.
mall
.
sentry
.
config
;
import
cn.iocoder.mall.sentry.resolver.DoNothingExceptionResolver
;
import
io.sentry.spring.SentryExceptionResolver
;
import
io.sentry.spring.autoconfigure.SentryAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.HandlerExceptionResolver
;
/**
* 自定义的 Sentry 自动配置类
*
* @author Hccake 2020/8/6
* @version 1.0
*/
@ConditionalOnClass
({
HandlerExceptionResolver
.
class
,
SentryExceptionResolver
.
class
})
@ConditionalOnWebApplication
@ConditionalOnProperty
(
name
=
"sentry.enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
@Configuration
(
proxyBeanMethods
=
false
)
public
class
CustomSentryAutoConfiguration
{
/**
* 用于覆盖原有的 SentryStarter 提供的 SentryExceptionResolver 操作
* 解决使用 log appender 形式推送错误信息与全局异常捕获导致重复推送的情况
*
* @return DoNothingExceptionResolver
*/
@Bean
@ConditionalOnClass
(
SentryAutoConfiguration
.
class
)
@ConditionalOnMissingBean
(
SentryExceptionResolver
.
class
)
public
SentryExceptionResolver
doNothingExceptionResolver
()
{
return
new
DoNothingExceptionResolver
();
}
}
归档/common/mall-spring-boot-starter-sentry/src/main/java/cn/iocoder/mall/sentry/resolver/DoNothingExceptionResolver.java
deleted
100644 → 0
浏览文件 @
3012ff84
package
cn
.
iocoder
.
mall
.
sentry
.
resolver
;
import
io.sentry.spring.SentryExceptionResolver
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
* 默认什么也不做的 SentryExceptionResolver
*
* @author Hccake 2020/8/6
* @version 1.0
*/
public
class
DoNothingExceptionResolver
extends
SentryExceptionResolver
{
@Override
public
ModelAndView
resolveException
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
// do nothing here
// null = run other HandlerExceptionResolvers to actually handle the exception
return
null
;
}
@Override
public
int
getOrder
()
{
return
Integer
.
MIN_VALUE
;
}
}
\ No newline at end of file
归档/common/mall-spring-boot-starter-sentry/src/main/resources/META-INF/spring.factories
deleted
100644 → 0
浏览文件 @
3012ff84
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.iocoder.mall.sentry.config.CustomSentryAutoConfiguration
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论