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 55import io .papermc .patchroulette .service .PatchService ;
66import java .util .List ;
77import org .springframework .beans .factory .annotation .Autowired ;
8+ import org .springframework .http .HttpStatus ;
89import org .springframework .http .ResponseEntity ;
910import org .springframework .security .access .prepost .PreAuthorize ;
1011import org .springframework .security .core .Authentication ;
12+ import org .springframework .web .bind .annotation .ExceptionHandler ;
1113import org .springframework .web .bind .annotation .GetMapping ;
1214import org .springframework .web .bind .annotation .PostMapping ;
1315import org .springframework .web .bind .annotation .RequestBody ;
@@ -136,4 +138,8 @@ public ResponseEntity<String> login() {
136138 return ResponseEntity .ok ("Your credentials are valid." );
137139 }
138140
141+ @ ExceptionHandler (IllegalStateException .class )
142+ public ResponseEntity <String > handleException (final IllegalStateException e ) {
143+ return ResponseEntity .status (HttpStatus .CONFLICT ).body (e .getMessage ());
144+ }
139145}
You can’t perform that action at this time.
0 commit comments