Sha256: ba0ce2818e6af65f9c7cc5f7c2494bf9e51fb29cc82a4554157f6b9495717440

Contents?: true

Size: 362 Bytes

Versions: 11

Compression:

Stored size: 362 Bytes

Contents

#coding: utf-8

module Ns
  class ResultError < RuntimeError
    attr_reader :result
    def initialize(result = nil)
      raise "Invalid result argument!" unless result.is_a?(Result)
      super(result.msg)
      @result = result
    end

    def to_s
      "RusultError: #{@result.status} #{@result.msg}, detail: #{@result.errors.inspect}"
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
ns_service_pack-0.1.8 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.7 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.6 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.5 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.4 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.3 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.2 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.1 lib/ns_service_pack/result_error.rb
ns_service_pack-0.1.0 lib/ns_service_pack/result_error.rb
ns_service_pack-0.0.21 lib/ns_service_pack/result_error.rb
nclient-0.0.6 lib/nclient/result_error.rb