module Triton::RemoteExceptions

This module “magically” defines any constants as RemoteExceptions, so when the server send back error structures such as:

{"code" => "WidgetInvalid", ...}

it means you can:

begin

...

rescue Triton::RemoteException::WidgetInvalid end

without having to exhaustively define all such exceptions beforehand

Public Class Methods

const_missing(name) click to toggle source
# File lib/triton/remote_exception.rb, line 18
def self.const_missing(name)
  klass = Class.new(RemoteException)
  RemoteExceptions.const_set(name, klass)
end