Exception: FrOData::RequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/frodata/errors.rb

Overview

Base class for network errors

Direct Known Subclasses

ClientError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = nil) ⇒ RequestError

Returns a new instance of RequestError.



10
11
12
13
14
# File 'lib/frodata/errors.rb', line 10

def initialize(response, message = nil)
  super(message)
  @message  = message
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



8
9
10
# File 'lib/frodata/errors.rb', line 8

def response
  @response
end

Instance Method Details

#default_messageObject



24
25
26
# File 'lib/frodata/errors.rb', line 24

def default_message
  nil
end

#http_statusObject



16
17
18
# File 'lib/frodata/errors.rb', line 16

def http_status
  response.status
end

#messageObject



20
21
22
# File 'lib/frodata/errors.rb', line 20

def message
  [default_message, @message].compact.join(': ')
end