Sha256: b5a461faa08e6611fa7505608e1fbcf5ae0cc1282fc0a8bcf7a4bc5275cefca0

Contents?: true

Size: 459 Bytes

Versions: 31

Compression:

Stored size: 459 Bytes

Contents

# encoding: utf-8

module Libis
  module Services

    class SoapError < Exception
      attr_accessor :code, :text, :detail, :name

      def initialize(error)
        @code = error[:fault][:faultcode] rescue nil
        @text = error[:fault][:faultstring] rescue nil
        @detail = error[:fault][:detail] rescue nil
        @name = @detail.first.first rescue nil
      end

      def message
        "#{code}:#{name} #{text}"
      end
    end

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
libis-services-1.1.0 lib/libis/services/soap_error.rb
libis-services-1.0.13 lib/libis/services/soap_error.rb
libis-services-1.0.12 lib/libis/services/soap_error.rb
libis-services-1.0.11 lib/libis/services/soap_error.rb
libis-services-1.0.10 lib/libis/services/soap_error.rb
libis-services-1.0.7 lib/libis/services/soap_error.rb
libis-services-1.0.6 lib/libis/services/soap_error.rb
libis-services-1.0.5 lib/libis/services/soap_error.rb
libis-services-1.0.2 lib/libis/services/soap_error.rb
libis-services-1.0.1 lib/libis/services/soap_error.rb
libis-services-1.0.0 lib/libis/services/soap_error.rb
libis-services-0.2.1 lib/libis/services/soap_error.rb
libis-services-0.2.0 lib/libis/services/soap_error.rb
libis-services-0.1.18 lib/libis/services/soap_error.rb
libis-services-0.1.17 lib/libis/services/soap_error.rb
libis-services-0.1.16 lib/libis/services/soap_error.rb
libis-services-0.1.15 lib/libis/services/soap_error.rb
libis-services-0.1.14 lib/libis/services/soap_error.rb
libis-services-0.1.13 lib/libis/services/soap_error.rb
libis-services-0.1.12 lib/libis/services/soap_error.rb