Feature #14688
closedNet::HTTPResponse#value raises "Net::HTTPServerException" in 4xx response
Description
Call value
method to an instance of Net::HTTPResponse
it raises Net::HTTPServerException
in case of HTTP response status code is 4xx.
But HTTP response status code 4xx means "Client error response" not "Server response" so I think that's wrong naming.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#Client_error_responses
Therefore, I think it's maybe specifications bug, but it cause breaking changes in many ruby programs to change exception name.
I propose to create Net::HTTPClientException
as alias of the Net::HTTPServerException
for compatibility.
Files
Updated by k0kubun (Takashi Kokubun) over 6 years ago
I like this. If nobody has an objection, I want to deprecate_constant
the old one, and would like the same fix for Net::ProtoServerError as well.
Updated by shevegen (Robert A. Heiler) over 6 years ago
The described transition path makes sense (to me).
Updated by usa (Usaku NAKAMURA) over 6 years ago
- Status changed from Open to Assigned
- Assignee set to naruse (Yui NARUSE)
At DevelopersMeeting20180419Japan, adding the alias is accepted.
Updated by unasuke (Yusuke Nakamura) over 6 years ago
- File lib_net_http_exceptions_with_deprecate.patch lib_net_http_exceptions_with_deprecate.patch added
k0kubun (Takashi Kokubun) wrote:
I like this. If nobody has an objection, I want to
deprecate_constant
the old one, and would like the same fix for Net::ProtoServerError as well.
I updated the patch. Like this?
Updated by naruse (Yui NARUSE) over 6 years ago
- Status changed from Assigned to Closed
Updated by naruse (Yui NARUSE) over 6 years ago
- Tracker changed from Bug to Feature
- ruby -v deleted (
2.6.0dev) - Backport deleted (
2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN)
Updated by usa (Usaku NAKAMURA) over 6 years ago
I suspect that deprecating Net::ProtoServerError
is wrong.
The exception seems to be "something error reported from server", and is derived not only by Net::HTTPServerException
but also Net::SMTPServerBusy
.