lib/vcap/rest_api/errors.rb
# Define a new rest api error class.
#
# @param [String] class_name Name of the class.
#
# @param [Integer] response_code HTTP response code
#
# @param [Integer] error_code VCAP specific error code.
#
# @param [String] format sprintf format string used to format the
# error message
Define a new rest api error class.
Define a new rest api error class .
def define_error(class_name, response_code, error_code, format)
        klass = Class.new Error do
          define_method :initialize do |*args|
            super(response_code, error_code, format, *args)
          end
        end
        const_set(class_name, klass)
      end
def define_error ( class_name , response_code , error_code , format ) klass = Class . new Error do define_method :initialize do | * args | super ( response_code , error_code , format , * args ) end end const_set ( class_name , klass ) end
Define a new rest api error class.
Define a new rest api error class .
class_name
<not_specific>
response_code
<not_specific>
error_code
<not_specific>
format
<not_specific>
<not_specific>
format sprintf format string used to format the error message
format sprintf format string used to format the error message