Sha256: 249ce13191afe4001011c5af4a744a3d231671ae23d5fd80d1a668304347c600

Contents?: true

Size: 1.21 KB

Versions: 35

Compression:

Stored size: 1.21 KB

Contents

module EBSCO

  module EDS
    class Error < StandardError
      attr_reader :fault
      def initialize(errors = nil)
        if errors
          @fault = errors
          super(errors[:error_body])
        end
      end
    end

    # raised with passing in invalid or unsupported parameter
    class InvalidParameter < StandardError; end

    # raised when attempting an action that is invalid/unsupported
    class ApiError < StandardError; end

    # Raised when trying an action that is not supported
    class NotImplemented < StandardError; end

    # HTTP related errors

    # raised when EDS returns the HTTP status code 400
    class BadRequest < Error; end

    # raised when EDS returns the HTTP status code 401
    class Unauthorized < Error; end

    # raised when EDS returns the HTTP status code 403
    class Forbidden < Error; end

    # raised when EDS returns the HTTP status code 404
    class NotFound < Error; end

    # Raised when EDS returns the HTTP status code 429
    class TooManyRequests < Error; end

    # Raised when EDS returns the HTTP status code 500
    class InternalServerError < Error; end

    # Raised when EDS returns the HTTP status code 503
    class ServiceUnavailable < Error; end

  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ebsco-eds-0.3.5.pre lib/ebsco/eds/error.rb
ebsco-eds-0.3.6.pre lib/ebsco/eds/error.rb
ebsco-eds-0.3.4.pre lib/ebsco/eds/error.rb
ebsco-eds-0.3.3.pre lib/ebsco/eds/error.rb
ebsco-eds-0.3.2.pre lib/ebsco/eds/error.rb
ebsco-eds-0.3.1.pre lib/ebsco/eds/error.rb
ebsco-eds-0.3.0.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.9.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.8.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.7.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.5.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.6.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.4.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.3.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.2.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.1.pre lib/ebsco/eds/error.rb
ebsco-eds-0.2.0.pre lib/ebsco/eds/error.rb
ebsco-eds-0.1.9.pre lib/ebsco/eds/error.rb
ebsco-eds-0.1.8.pre lib/ebsco/eds/error.rb
ebsco-eds-0.1.7.pre lib/ebsco/eds/error.rb