Class: Zold::Http::Error

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

Overview

The error, if connection fails

Instance Method Summary collapse

Constructor Details

#initialize(ex) ⇒ Error

Returns a new instance of Error.



111
112
113
# File 'lib/zold/http.rb', line 111

def initialize(ex)
  @ex = ex
end

Instance Method Details

#bodyObject



119
120
121
# File 'lib/zold/http.rb', line 119

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

#codeObject



123
124
125
# File 'lib/zold/http.rb', line 123

def code
  '599'
end

#headerObject



131
132
133
# File 'lib/zold/http.rb', line 131

def header
  {}
end

#messageObject



127
128
129
# File 'lib/zold/http.rb', line 127

def message
  @ex.message
end

#to_sObject



115
116
117
# File 'lib/zold/http.rb', line 115

def to_s
  "#{code}: #{message}\n#{body}"
end