Exception: Lce::Client::Errors::LceError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lce/client/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, type, details) ⇒ LceError

Returns a new instance of LceError.



6
7
8
9
10
# File 'lib/lce/client/errors.rb', line 6

def initialize(msg, type, details)
  super(msg)
  @type = type
  @details = details
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



5
6
7
# File 'lib/lce/client/errors.rb', line 5

def details
  @details
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/lce/client/errors.rb', line 5

def type
  @type
end

Instance Method Details

#to_sObject



11
12
13
14
15
16
# File 'lib/lce/client/errors.rb', line 11

def to_s
  s = super
  d = (@details.is_a? Array)? @details.join(' ') : @details
  s+= "\n#{d}" if d && !d.empty?
  s
end