暂时移除 mall-spring-boot-starter-sentry 的封装

pull/4/head
YunaiV 2022-06-25 15:17:00 +08:00
parent 3012ff84a2
commit fcfa66100c
4 changed files with 0 additions and 98 deletions

View File

@ -1,25 +0,0 @@
<?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>

View File

@ -1,39 +0,0 @@
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();
}
}

View File

@ -1,32 +0,0 @@
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;
}
}

View File

@ -1,2 +0,0 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.iocoder.mall.sentry.config.CustomSentryAutoConfiguration