Sha256: 24d0b6963f4a773f23c093ac46cf3c367b7a82671a4794c9758f4e6491a63592

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

module GnipApi
  module Errors
    module Configuration
      class InvalidOutputFormat < StandardError
        def initialize msg="Invalid output format. Available formats: #{GnipApi::Configuration::OUTPUT_FORMATS}"
          @message = msg
        end
      end
    end

    module JsonParser
      class ParseError < StandardError
      end
    end

    module Adapter
      class RequestError < StandardError
        def initialize msg='Request failed'
          @message = msg
        end
      end

      class RateLimitError < StandardError
        def initialize msg='Exceded rate limits'
          @message = msg
        end
      end

      class GnipSoftwareError < StandardError
        def initialize msg='Gnip Software Error'
          @message = msg
        end
      end
    end

    module PowerTrack
      class MissingRules < StandardError
        def initialize
          @message = 'No rules provided to operate'
        end
      end
    end

    module Search
      class MissingParameters < StandardError
        def initialize missing_params
          @message = "Missing required parameters: #{missing_params}"
        end
      end
    end

    class MissingCredentials < StandardError
      def initialize
        @message = 'No credentials provided'
      end
    end
    
    class MissingAdapter < StandardError
      def initialize
        @message = 'No adapter selected'
      end
    end
  end
end

module Gnip
  class UndefinedMessage < StandardError
    def initialize 
      @message = 'Could not recognize message received'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gnip_api-1.1.3 lib/gnip_api/errors.rb
gnip_api-1.1.2 lib/gnip_api/errors.rb