Sha256: caff8d876ea0935c474eaea791c2c5d48e5439c14da084435a621174f6d318c2

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

module GoogleMapsService
  # Specific Google Maps Service error
  module Error
    # Base error, capable of wrapping another
    class BaseError < StandardError
      # HTTP response object
      # @return [Faraday::Response]
      attr_reader :response

      # Initialize error
      #
      # @param [Faraday::Response] response HTTP response.
      def initialize(response = nil)
        @response = response
      end
    end

    # The response redirects to another URL.
    class RedirectError < BaseError
    end

    # A 4xx class HTTP error occurred.
    # The request is invalid and should not be retried without modification.
    class ClientError < BaseError
    end

    # A 5xx class HTTP error occurred.
    # An error occurred on the server and the request can be retried.
    class ServerError < BaseError
    end

    # An unknown error occured.
    class UnknownError < BaseError
    end

    # General Google Maps Web Service API error occured.
    class ApiError < BaseError
    end

    # Requiered query is missing
    class InvalidRequestError < ApiError
    end

    # The quota for the credential is over limit.
    class RateLimitError < ApiError
    end

    # An unathorized error occurred. It might be caused by invalid key/secret or invalid access.
    class RequestDeniedError < ApiError
    end

    # When an Address is not found. i.e. An address string could not be geocoded
    class NotFoundError < ApiError
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google_map_services-0.1.0.0 lib/google_maps_service/errors.rb