Exception: GramV2Client::ResourceNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/gram_v2_client/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query: nil, resource: nil, source_exception: nil) ⇒ ResourceNotFound

Returns a new instance of ResourceNotFound.



10
11
12
13
14
15
# File 'lib/gram_v2_client/exceptions.rb', line 10

def initialize(query: nil, resource: nil, source_exception: nil)
  @error=self.class.name
  @query=query
  @resource=resource
  @source_exception=source_exception
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



5
6
7
# File 'lib/gram_v2_client/exceptions.rb', line 5

def query
  @query
end

#resourceObject (readonly)

Returns the value of attribute resource.



6
7
8
# File 'lib/gram_v2_client/exceptions.rb', line 6

def resource
  @resource
end

#source_exceptionObject (readonly)

Returns the value of attribute source_exception.



7
8
9
# File 'lib/gram_v2_client/exceptions.rb', line 7

def source_exception
  @source_exception
end

Instance Method Details

#to_sObject



17
18
19
20
21
# File 'lib/gram_v2_client/exceptions.rb', line 17

def to_s
  message = "Failed."
  message << " #{resource} not found" if resource
  message << " with query '#{query}'" if query
end