Exception: Mailgun::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/mailgun/exceptions/exceptions.rb

Direct Known Subclasses

CommunicationError, ParameterError, ParseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, object = nil) ⇒ Error

Returns a new instance of Error.



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

def initialize(message=nil, object=nil)
  @message = message
  @object = object
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



4
5
6
# File 'lib/mailgun/exceptions/exceptions.rb', line 4

def object
  @object
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/mailgun/exceptions/exceptions.rb', line 11

def to_s
  @message || self.class.to_s
end