Exception: Drunit::RemoteError

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

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception_name) ⇒ RemoteError

Returns a new instance of RemoteError.



11
12
13
# File 'lib/drunit/remote_error.rb', line 11

def initialize(exception_name)
  @exception_name = exception_name.to_s
end

Class Attribute Details

.nameObject



5
6
7
# File 'lib/drunit/remote_error.rb', line 5

def name
  @name || super
end

Instance Method Details

#classObject



15
16
17
18
19
20
# File 'lib/drunit/remote_error.rb', line 15

def class
  type = look_up_exception
  return type if type
  super.name = @exception_name #Now we hope and prey that the name of the class is checked imidiately
  super
end

#look_up_exceptionObject



22
23
24
25
26
# File 'lib/drunit/remote_error.rb', line 22

def look_up_exception
  @exception_name.split("::").inject(Object){|node, part|
    node && node.const_defined?(part) && node.const_get(part)
  }
end