Exception: Fleet::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/fleet/error.rb

Direct Known Subclasses

ConnectionError

Constant Summary collapse

HTTP_CODE_MAP =
{
  400 => 'BadRequest',
  401 => 'Unauthorized',
  403 => 'Forbidden',
  404 => 'NotFound',
  405 => 'MethodNotAllowed',
  406 => 'NotAcceptable',
  408 => 'RequestTimeout',
  409 => 'Conflict',
  412 => 'PreconditionFailed',
  413 => 'RequestEntityTooLarge',
  414 => 'RequestUriTooLong',
  415 => 'UnsupportedMediaType',
  416 => 'RequestRangeNotSatisfiable',
  417 => 'ExpectationFailed',
  500 => 'InternalServerError',
  501 => 'NotImplemented',
  502 => 'BadGateway',
  503 => 'ServiceUnavailable',
  504 => 'GatewayTimeout'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, error_code = nil) ⇒ Error

Returns a new instance of Error.



7
8
9
10
# File 'lib/fleet/error.rb', line 7

def initialize(msg, error_code=nil)
  super(msg)
  @error_code = error_code
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



5
6
7
# File 'lib/fleet/error.rb', line 5

def cause
  @cause
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



4
5
6
# File 'lib/fleet/error.rb', line 4

def error_code
  @error_code
end