Sha256: a300ff669c256e9b897442d2d8c5e7de2277598c495f5b99db654fea17f563b1

Contents?: true

Size: 477 Bytes

Versions: 6

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module ActsAsTextcaptcha
  class ResponseError < StandardError
    def initialize(url, exception)
      super("fetching '#{url}' failed - #{exception}")
    end
  end

  class ApiKeyError < StandardError
    def initialize(api_key, exception)
      super("Api key '#{api_key}' is invalid - #{exception}")
    end
  end

  class ParseError < StandardError
    def initialize(url)
      super("parsing JSON from '#{url}' failed")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acts_as_textcaptcha-4.7.1 lib/acts_as_textcaptcha/errors.rb
acts_as_textcaptcha-4.7.0 lib/acts_as_textcaptcha/errors.rb
acts_as_textcaptcha-4.6.0 lib/acts_as_textcaptcha/errors.rb
acts_as_textcaptcha-4.5.2 lib/acts_as_textcaptcha/errors.rb
acts_as_textcaptcha-4.5.1 lib/acts_as_textcaptcha/errors.rb
acts_as_textcaptcha-4.5.0 lib/acts_as_textcaptcha/errors.rb