Project

General

Profile

Bug #14688

Net::HTTPResponse#value raises "Net::HTTPServerException" in 4xx response

Added by unasuke (Yusuke Nakamura) 5 days ago. Updated 1 day ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:86545]

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.

lib_net_http_exceptions.patch (999 Bytes) lib_net_http_exceptions.patch unasuke (Yusuke Nakamura), 04/15/2018 01:35 PM

History

#1 [ruby-core:86549] Updated by k0kubun (Takashi Kokubun) 4 days 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.

#2 [ruby-core:86557] Updated by shevegen (Robert A. Heiler) 3 days ago

The described transition path makes sense (to me).

#3 [ruby-core:86608] Updated by usa (Usaku NAKAMURA) 1 day ago

  • Assignee set to naruse (Yui NARUSE)
  • Status changed from Open to Assigned

At DevelopersMeeting20180419Japan, adding the alias is accepted.

Also available in: Atom PDF