Sha256: 1dddddc831eed97bd20b0a2dccb03bdcbfe3b353d992395fb66ae7fcbc1bc405
Contents?: true
Size: 800 Bytes
Versions: 2
Compression:
Stored size: 800 Bytes
Contents
module HawatelPS module Windows class WmiCliException < Exception # Custom exception # @param args [Hash] the options to create a custom exception message # @option :exception [Exception] Native Exception object # @option :message [String] Custom message # @return [void] def initialize(args = {:exception => nil, :message => nil}) super(exception_enrichment(args)) end private def exception_enrichment(args) error_message = '' error_message += args[:message] unless args[:message].nil? error_message += "\nNative exception from '#{args[:exception].class}':\n#{args[:exception].message}" unless args[:exception].nil? return error_message end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hawatel_ps-0.1.2 | lib/hawatel_ps/windows/wmi/wmi_exception.rb |
hawatel_ps-0.1.1 | lib/hawatel_ps/windows/wmi/wmi_exception.rb |