Skip to content

Commit 6882746

Browse files
committed
Improve client error messages
1 parent 76de0ab commit 6882746

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

JShellAPI/src/main/java/org/togetherjava/jshellapi/exceptions/DockerException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package org.togetherjava.jshellapi.exceptions;
22

3+
import org.springframework.http.HttpStatus;
4+
import org.springframework.web.bind.annotation.ResponseStatus;
5+
6+
@ResponseStatus(value= HttpStatus.CONFLICT, reason="Session may have been forcibly destroyed.")
37
public class DockerException extends Exception {
48
public DockerException() {
59
}

JShellAPI/src/main/resources/application.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ jshellapi.schedulerSessionKillScanRateSeconds=60
1616

1717
# Docker service config
1818
jshellapi.dockerResponseTimeout=60
19-
jshellapi.dockerConnectionTimeout=60
19+
jshellapi.dockerConnectionTimeout=60
20+
21+
22+
# So Spring includes the reason of ResponseStatusException
23+
server.error.include-message=always

0 commit comments

Comments
 (0)