Class: Zold::HttpError

Inherits:
HttpResponse show all
Defined in:
lib/zold/http.rb

Overview

The error, if connection fails

Instance Method Summary collapse

Methods inherited from HttpResponse

#to_s

Constructor Details

#initialize(ex) ⇒ HttpError

Returns a new instance of HttpError.



35
36
37
38
# File 'lib/zold/http.rb', line 35

def initialize(ex)
  super
  @ex = ex
end

Instance Method Details

#bodyObject



40
41
42
# File 'lib/zold/http.rb', line 40

def body
  Backtrace.new(@ex).to_s
end

#headersObject



52
53
54
# File 'lib/zold/http.rb', line 52

def headers
  {}
end

#statusObject



44
45
46
# File 'lib/zold/http.rb', line 44

def status
  599
end

#status_lineObject



48
49
50
# File 'lib/zold/http.rb', line 48

def status_line
  @ex.message || ''
end