Sha256: 993d15bf1a30e862f170ca4d54d2f1d875f53065e90948724d630c685012935f

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

module FbErrorMachine

  class MarketingApiError < ErrorBase

    attr_accessor :error_code, :description, :instructions

    def self.all
      @_errors ||= begin
        YAML.load_file(File.join(File.dirname(__FILE__), "marketing_api_errors.yml")).map do |entry|
          GraphApiError.new(entry)
        end
      rescue Psych::SyntaxError, Errno::EACCES, Errno::ENOENT
        {}
      end
    end

    def self.find(error_code)
      MarketingApiError.all.detect { |e| e.error_code == error_code.to_s }
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_error_machine-0.1.1 lib/fb_error_machine/marketing_api_error.rb