Exception: Croudia::Error::NetworkError

Inherits:
Croudia::Error show all
Defined in:
lib/croudia/error.rb

Overview

Error connecting to server

Direct Known Subclasses

Timeout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e) ⇒ NetworkError

Returns a new instance of NetworkError.



8
9
10
11
# File 'lib/croudia/error.rb', line 8

def initialize(e)
  @wrapped_exception = e
  super(e.respond_to?(:message) ? e.message : e.to_s)
end

Instance Attribute Details

#wrapped_exceptionObject (readonly)

Returns the value of attribute wrapped_exception.



6
7
8
# File 'lib/croudia/error.rb', line 6

def wrapped_exception
  @wrapped_exception
end

Instance Method Details

#backtraceObject



13
14
15
16
17
18
19
# File 'lib/croudia/error.rb', line 13

def backtrace
  if @wrapped_exception.respond_to?(:backtrace)
    @wrapped_exception.backtrace
  else
    super
  end
end