Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from corona-warn-app/fix/catch_client_abort_ex…
Browse files Browse the repository at this point in the history
…ception

fix: catch client abort exception
  • Loading branch information
mschulte-tsi authored Oct 1, 2021
2 parents 69e3947 + 7f7d93f commit ec0326d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.IOException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.connector.ClientAbortException;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand All @@ -45,6 +46,11 @@ public void handleIoException() {
log.error("IOException thrown.");
}

@ExceptionHandler(ClientAbortException.class)
public void handleClientAbortException() {
log.error("ClientAbortException thrown.");
}

/**
* Global Exception Handler to wrap exceptions into a readable JSON Object.
*
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>

<logger name="eu.europa.ec" level="DEBUG"/>
<logger name="eu.europa.ec" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
Expand All @@ -19,7 +19,7 @@
<appender-ref ref="STDOUT-JSON"/>
</root>

<logger name="eu.europa.ec" level="DEBUG"/>
<logger name="eu.europa.ec" level="INFO"/>
</springProfile>

</configuration>

0 comments on commit ec0326d

Please sign in to comment.