File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/main/java/io/papermc/patchroulette/controller Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 5
5
import io .papermc .patchroulette .service .PatchService ;
6
6
import java .util .List ;
7
7
import org .springframework .beans .factory .annotation .Autowired ;
8
+ import org .springframework .http .HttpStatus ;
8
9
import org .springframework .http .ResponseEntity ;
9
10
import org .springframework .security .access .prepost .PreAuthorize ;
10
11
import org .springframework .security .core .Authentication ;
12
+ import org .springframework .web .bind .annotation .ExceptionHandler ;
11
13
import org .springframework .web .bind .annotation .GetMapping ;
12
14
import org .springframework .web .bind .annotation .PostMapping ;
13
15
import org .springframework .web .bind .annotation .RequestBody ;
@@ -136,4 +138,8 @@ public ResponseEntity<String> login() {
136
138
return ResponseEntity .ok ("Your credentials are valid." );
137
139
}
138
140
141
+ @ ExceptionHandler (IllegalStateException .class )
142
+ public ResponseEntity <String > handleException (final IllegalStateException e ) {
143
+ return ResponseEntity .status (HttpStatus .CONFLICT ).body (e .getMessage ());
144
+ }
139
145
}
You can’t perform that action at this time.
0 commit comments