Sha256: 78e88c1fa3791fdf608840ce97ce2512e4497088bb92a3fa45c07a0693488b50

Contents?: true

Size: 834 Bytes

Versions: 3

Compression:

Stored size: 834 Bytes

Contents

module Yoti
  # Raises exceptions related to Protobuf decoding
  class ProtobufError < StandardError; end

  # Raises exceptions related to API requests
  class RequestError < StandardError
    attr_reader :response

    def initialize(message, response = nil)
      super(message)
      @response = response
    end

    def message
      return super if @response.nil? || @response.body.empty?

      "#{super}: #{@response.body}"
    end
  end

  # Raises exceptions related to OpenSSL actions
  class SslError < StandardError; end

  # Raises exceptions related to an incorrect gem configuration value
  class ConfigurationError < StandardError; end

  # Raises exceptions related to AML actions
  class AmlError < StandardError; end

  # Raises exceptions related to Profile actions
  class ProfileError < StandardError; end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yoti-1.10.0 lib/yoti/errors.rb
yoti-1.9.0 lib/yoti/errors.rb
yoti-1.8.0 lib/yoti/errors.rb