Exception: DocRaptorException::DocRaptorRequestException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/doc_raptor/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code) ⇒ DocRaptorRequestException

Returns a new instance of DocRaptorRequestException.


5
6
7
8
9
# File 'lib/doc_raptor/exception.rb', line 5

def initialize(message, status_code)
  self.message     = message
  self.status_code = status_code
  super message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message


4
5
6
# File 'lib/doc_raptor/exception.rb', line 4

def message
  @message
end

#status_codeObject

Returns the value of attribute status_code


3
4
5
# File 'lib/doc_raptor/exception.rb', line 3

def status_code
  @status_code
end

Instance Method Details

#inspectObject


15
16
17
# File 'lib/doc_raptor/exception.rb', line 15

def inspect
  self.to_s
end

#to_sObject


11
12
13
# File 'lib/doc_raptor/exception.rb', line 11

def to_s
  "#{self.class.name}\nHTTP Status: #{status_code}\nReturned: #{message}"
end