exception : spring - DefaultHandlerExceptionResolver
This commit is contained in:
@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
@@ -40,6 +41,11 @@ public class ApiExceptionController {
|
||||
public String responseStatusEx2() {
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "error.bad", new IllegalArgumentException());
|
||||
}
|
||||
|
||||
@GetMapping("/api/default-handler-ex")
|
||||
public String defaultException(@RequestParam Integer data) {
|
||||
return "ok";
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
||||
Reference in New Issue
Block a user