-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
deprecate HttpResponse::getStatus #11284
Conversation
This pull-request deprecates `HttpResponse::getStatus` and `HttpClientResponseException::getStatus`. It adds `HttpClientResponseException::code`, and `HttpClientResponseException::reason` methods. In order to be custom status codes compatible is better for people to use `HttpResponse::code` instead of `HttpResponse::getStatus`. For example, we hit an issue in Micrometer micronaut-projects/micronaut-micrometer#857 I have annotated the method as deprecated but not for removal. I don’t think we should remove it as it will break a lot of apps and tests.
I think this will be a large and disruptive deprecation for a lot of codebases. Not sure it is worth deprecating to be honest |
I think we should avoid getStatus in framework code, but for most users, it's not really a problem to use because they don't use custom status types in the first place. |
The problem is how to convey this to @micronaut-projects/core-developers without deprecating it. |
...ient-core/src/main/java/io/micronaut/http/client/exceptions/HttpClientResponseException.java
Outdated
Show resolved
Hide resolved
...ient-core/src/main/java/io/micronaut/http/client/exceptions/HttpClientResponseException.java
Outdated
Show resolved
Hide resolved
…ions/HttpClientResponseException.java
…ions/HttpClientResponseException.java
@graemerocher @yawkat I have removed the deprecation but kept the javadoc clarifications. Can you re-review? |
|
This pull-request deprecates
HttpResponse::getStatus
andHttpClientResponseException::getStatus
. It addsHttpClientResponseException::code
, andHttpClientResponseException::reason
methods.In order to be custom status codes compatible is better for people to use
HttpResponse::code
instead ofHttpResponse::getStatus
.For example, we hit an issue in Micrometer micronaut-projects/micronaut-micrometer#857
I have annotated the method as deprecated but not for removal. I don’t think we should remove it as it will break a lot of apps and tests.