lib/ezid/responses/response.rb in ezid-client-1.9.0 vs lib/ezid/responses/response.rb in ezid-client-1.9.1

- old
+ new

@@ -13,15 +13,12 @@ # Error response status ERROR = "error".freeze def initialize(http_response) - super + http_response.value # raises Net::HTTPServerException - unless __getobj__.code =~ /2\d\d/ - raise Error, "HTTP response error: %s %s" % - [ __getobj__.code, __getobj__.message ] - end + super unless status_line =~ /^(#{SUCCESS}|#{ERROR}): / raise UnexpectedResponseError, __getobj__.body end end