aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-03-11 14:36:45 +0300
committerGravatar Vitaly Takmazov2023-03-11 14:36:45 +0300
commit23f8b345b940841f5801245f191520698904779e (patch)
tree3a193b1717d2ab712cab3a8559835f0509122d68
parent65ca0b7f8565da2e1ce87c219c2fd53e30be7f1f (diff)
Revert "Switch to Tomcat and omit its exceptions from logs"
This reverts commit 64e6b703b7fa50a31dc0b73ec85230aa99c77bd5.
-rw-r--r--pom.xml16
-rw-r--r--src/main/java/com/juick/www/api/Index.java20
2 files changed, 17 insertions, 19 deletions
diff --git a/pom.xml b/pom.xml
index 6d8981d0..b2c11504 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,6 +35,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -66,6 +72,16 @@
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-undertow</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-websockets-jsr</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
diff --git a/src/main/java/com/juick/www/api/Index.java b/src/main/java/com/juick/www/api/Index.java
index 1c990c65..7430c22d 100644
--- a/src/main/java/com/juick/www/api/Index.java
+++ b/src/main/java/com/juick/www/api/Index.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2023, Juick
+ * Copyright (C) 2008-2021, Juick
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -33,7 +33,6 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
-import java.io.IOException;
import java.net.URI;
/**
@@ -62,21 +61,4 @@ public class Index {
public ResponseEntity<String> badRequest(final ConstraintViolationException exception) {
return ResponseEntity.badRequest().body(exception.getMessage());
}
- @ExceptionHandler(IOException.class)
- public ResponseEntity<String> handleAbortedConnection(final IOException ex)
- {
- // avoids compile/runtime dependency by using class name
- if (ex.getClass().getName().equals("org.apache.catalina.connector.ClientAbortException"))
- {
- return null;
- }
-
- // log and return error page for any other IOExceptions
- if (logger.isWarnEnabled())
- {
- logger.warn("IO Error", ex);
- }
-
- return ResponseEntity.badRequest().body(ex.getMessage());
- }
}