diff --git a/Library/Contributions/cmd/brew-gist-logs.rb b/Library/Contributions/cmd/brew-gist-logs.rb index d5f6bb3a64..66fcd30f9b 100755 --- a/Library/Contributions/cmd/brew-gist-logs.rb +++ b/Library/Contributions/cmd/brew-gist-logs.rb @@ -79,7 +79,7 @@ def post path, data end request.body = Utils::JSON.dump(data) response = http.request(request) - raise HTTP_Error, response if response.code != '201' + raise "HTTP #{response.code} #{response.message}" if response.code != "201" if !response.body.respond_to?(:force_encoding) body = response.body @@ -92,12 +92,6 @@ def post path, data Utils::JSON.load(body) end -class HTTP_Error < RuntimeError - def initialize response - super "HTTP #{response.code} #{response.message}" - end -end - def usage puts "usage: brew gist-logs [options] " puts