Sha256: dba843de5276089bdc92a4f0612c5a70a3e435ddd31608ceb4454154ef937d8a

Contents?: true

Size: 873 Bytes

Versions: 3

Compression:

Stored size: 873 Bytes

Contents

# frozen_string_literal: true

class Valvat
  Error = Class.new(RuntimeError)

  class ViesError < Error
    def initialize(faultstring = 'UNKNOWN', exception = nil)
      @faultstring = faultstring || exception.inspect
      @exception = exception
      super(faultstring)
    end

    def to_s
      "The VIES web service returned the error '#{@faultstring}'."
    end

    def eql?(other)
      to_s.eql?(other.to_s)
    end
  end
  ViesMaintenanceError = Class.new(ViesError)

  ServiceUnavailable = Class.new(ViesMaintenanceError)
  MemberStateUnavailable = Class.new(ViesMaintenanceError)

  OperationUnknown = Class.new(ViesError)
  HTTPError = Class.new(ViesError)
  Timeout = Class.new(ViesError)
  InvalidRequester = Class.new(ViesError)
  BlockedError = Class.new(ViesError)
  RateLimitError = Class.new(ViesError)

  UnknownViesError = Class.new(ViesError)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
valvat-1.1.5 lib/valvat/error.rb
valvat-1.1.4 lib/valvat/error.rb
valvat-1.1.3 lib/valvat/error.rb