Exception: ResoTransport::ResourceError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/reso_transport/errors.rb

Direct Known Subclasses

EncodeError, LocalizationRequired, RequestError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ ResourceError

Returns a new instance of ResourceError.



5
6
7
8
# File 'lib/reso_transport/errors.rb', line 5

def initialize(resource)
  @resource = resource
  super message
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



3
4
5
# File 'lib/reso_transport/errors.rb', line 3

def resource
  @resource
end

Instance Method Details

#messageObject



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

def message
  "Request error for #{resource_name}"
end

#resource_nameObject



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

def resource_name
  return resource.name if resource.respond_to?(:name)

  resource || 'unknown'
end