Skip to content

Commit 1165481

Browse files
authored
Update README.md
1 parent 53105df commit 1165481

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ ErrorHandler
4949

5050
// Bind HTTP 404 status to 404
5151
.bind(404, errorCode -> throwable -> {
52-
return ((HttpException) throwable).code() == 404;
52+
return throwable instanceof HttpException && ((HttpException) throwable).code() == 404;
5353
})
5454

5555
// Bind HTTP 500 status to 500
5656
.bind(500, errorCode -> throwable -> {
57-
return ((HttpException) throwable).code() == 500;
57+
return throwable instanceof HttpException && ((HttpException) throwable).code() == 500;
5858
})
5959

6060
// Bind all DB errors to a custom enumeration

0 commit comments

Comments
 (0)