Exception: Bitly4R::Error

Inherits:
Exception
  • Object
show all
Defined in:
lib/bitly4r/objects.rb

Overview

Error

A Module-specific Exception class

– i would have called it Bitly4R::Exception except that i don’t know how to access Kernel::Exception within the initialize logic ++

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, cause = nil) ⇒ Error

Provide a message and an optional ‘causing’ Exception.

If no message is passed – eg. only an Exception – then this Exception inherits its message.



25
26
27
28
29
30
31
32
33
# File 'lib/bitly4r/objects.rb', line 25

def initialize(message, cause=nil)
	if (Exception === message)
		super message.to_s
		@cause = message
	else
		super message
		@cause = cause
	end
end

Instance Attribute Details

#causeObject

The propagated cause of this Exception, if appropriate



20
21
22
# File 'lib/bitly4r/objects.rb', line 20

def cause
  @cause
end