module HomeAway::API::Errors

a collection of error classes corresponding to various errors that might be raised by the HomeAway API

Public Class Methods

for_http_code(status_code) click to toggle source

@private

# File lib/homeaway/api/errors/ha_api_errors.rb, line 129
def self.for_http_code(status_code)
  begin
    self.const_get(self.constants.select do |c|
      const = self.const_get c
      Class === const &&
          const.const_defined?(:CODE) &&
          const.const_get(:CODE) == status_code.to_i
    end.first)
  rescue => _
    HomeAwayAPIError
  end
end