Module: Sonycam::Error

Defined in:
lib/sonycam/error.rb

Constant Summary collapse

MAPPING =
{
  1     => :Any,
  2     => :Timeout,
  3     => :IllegalArgument,
  4     => :IllegalDataFormat,
  5     => :IllegalRequest,
  6     => :IllegalResponse,
  7     => :IllegalState,
  8     => :IllegalType,
  9     => :IndexOutOfBounds,
  10    => :NoSuchElement,
  11    => :NoSuchField,
  12    => :NoSuchMethod,
  13    => :NULLPointer,
  14    => :UnsupportedVersion,
  15    => :UnsupportedOperation,
  40400 => :Shootingfail,
  40401 => :CameraNotReady,
  40402 => :AlreadyRunningPollingAPI147,
  40403 => :StillCapturingNotFinished,
  401   => :Unauthorized,
  403   => :Forbidden,
  404   => :NotFound,
  406   => :NotAcceptable,
  413   => :RequestEntityTooLarge,
  414   => :RequestURITooLong,
  501   => :NotImplemented,
  503   => :ServiceUnavailable
}

Class Method Summary collapse

Class Method Details

.make(code) ⇒ Object



37
38
39
# File 'lib/sonycam/error.rb', line 37

def self.make code
  const_get(MAPPING[code])
end