-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw WARN/INFO instead of ERROR on 404 #423
Comments
I'm not sure I understand this correctly but doesn't this effectively treat a number of 2xx family status codes as errors? As for @karoldrazek 's suggestion, perhaps the log level could be different for 4xx codes (warn/info) and for 5xx codes (error), the rationale being that the 400s can usually be fixed by the client by changing the request accordingly, whereas the 500s are server-side errors beyond the client's control. |
@toniedzwiedz check the condition, the response is logged as error if status code is different than
And small tip. Instead of checking ranges of status codes, you can use a import io.netty.handler.codec.http.HttpStatusClass;
HttpStatusClass.SERVER_ERROR.contains(httpResponse.statusCode()); |
Logging |
Fixed in #427 |
Please kindly consider throwing WARN or INFO rather than ERROR when there's 404 being thrown from repository.
Relevant code part:
https://github.com/Cognifide/knotx/blob/master/knotx-core/src/main/java/io/knotx/repository/http/HttpRepositoryConnectorProxyImpl.java#L151
The text was updated successfully, but these errors were encountered: