We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53105df commit 1165481Copy full SHA for 1165481
1 file changed
README.md
@@ -49,12 +49,12 @@ ErrorHandler
49
50
// Bind HTTP 404 status to 404
51
.bind(404, errorCode -> throwable -> {
52
- return ((HttpException) throwable).code() == 404;
+ return throwable instanceof HttpException && ((HttpException) throwable).code() == 404;
53
})
54
55
// Bind HTTP 500 status to 500
56
.bind(500, errorCode -> throwable -> {
57
- return ((HttpException) throwable).code() == 500;
+ return throwable instanceof HttpException && ((HttpException) throwable).code() == 500;
58
59
60
// Bind all DB errors to a custom enumeration
0 commit comments