Skip to content

Commit c3df8c5

Browse files
Return status 404 instead of status 403 on 'Not Found' exception.
1 parent e9efded commit c3df8c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/github/hrytsenko/jsondata/springboot/error/ExceptionAdvices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public ErrorResponse onForbidden(ServiceException.Forbidden exception) {
8585
}
8686

8787
@ExceptionHandler(ServiceException.NotFound.class)
88-
@ResponseStatus(code = HttpStatus.FORBIDDEN)
88+
@ResponseStatus(code = HttpStatus.NOT_FOUND)
8989
public ErrorResponse onNotFound(ServiceException.NotFound exception) {
9090
log.error("Not found", exception);
9191
return ErrorResponse.create(exception.getCode(), correlationSource.getCorrelation());

0 commit comments

Comments
 (0)