Exception: GPhoto2::Error

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

Overview

A runtime error for unsuccessful return codes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code) ⇒ Error

Returns a new instance of Error.

Parameters:

  • message (String)
  • code (Integer)


51
52
53
54
# File 'lib/gphoto2.rb', line 51

def initialize(message, code)
  super(message)
  @code = code
end

Instance Attribute Details

#codeInteger (readonly)

Returns:

  • (Integer)


47
48
49
# File 'lib/gphoto2.rb', line 47

def code
  @code
end

Instance Method Details

#to_sString

Returns:

  • (String)


57
58
59
# File 'lib/gphoto2.rb', line 57

def to_s
  "#{super} (#{code})"
end