Exception: Croudia::Error::ConnectionError

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

Overview

Error connected to server

Direct Known Subclasses

ClientError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ ConnectionError

Returns a new instance of ConnectionError.



28
29
30
31
32
33
# File 'lib/croudia/error.rb', line 28

def initialize(env)
  @code = env[:status]
  @error = env[:body]['error'] rescue nil
  @env = env
  super(@error)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



26
27
28
# File 'lib/croudia/error.rb', line 26

def code
  @code
end

#envObject (readonly)

Returns the value of attribute env.



26
27
28
# File 'lib/croudia/error.rb', line 26

def env
  @env
end

#errorObject (readonly)

Returns the value of attribute error.



26
27
28
# File 'lib/croudia/error.rb', line 26

def error
  @error
end