diff --git a/src/main/java/com/accolite/pru/health/AuthApp/advice/AuthControllerAdvice.java b/src/main/java/com/accolite/pru/health/AuthApp/advice/AuthControllerAdvice.java index 958b183..d823e79 100644 --- a/src/main/java/com/accolite/pru/health/AuthApp/advice/AuthControllerAdvice.java +++ b/src/main/java/com/accolite/pru/health/AuthApp/advice/AuthControllerAdvice.java @@ -111,7 +111,7 @@ public ApiResponse handleAppException(AppException ex, WebRequest request) { } @ExceptionHandler(value = ResourceAlreadyInUseException.class) - @ResponseStatus(HttpStatus.IM_USED) + @ResponseStatus(HttpStatus.CONFLICT) @ResponseBody public ApiResponse handleResourceAlreadyInUseException(ResourceAlreadyInUseException ex, WebRequest request) { return new ApiResponse(false, ex.getMessage(), ex.getClass().getName(), resolvePathFromWebRequest(request)); diff --git a/src/main/java/com/accolite/pru/health/AuthApp/exception/ResourceAlreadyInUseException.java b/src/main/java/com/accolite/pru/health/AuthApp/exception/ResourceAlreadyInUseException.java index bf59272..1c7eaf6 100644 --- a/src/main/java/com/accolite/pru/health/AuthApp/exception/ResourceAlreadyInUseException.java +++ b/src/main/java/com/accolite/pru/health/AuthApp/exception/ResourceAlreadyInUseException.java @@ -16,7 +16,7 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; -@ResponseStatus(HttpStatus.IM_USED) +@ResponseStatus(HttpStatus.CONFLICT) public class ResourceAlreadyInUseException extends RuntimeException { private final String resourceName;