class Hpe3parSdk::Util

Public Class Methods

log_exception(exception, caller_location) click to toggle source
# File lib/Hpe3parSdk/util.rb, line 22
def self.log_exception(exception, caller_location)
  formatted_stack_trace = exception.backtrace
                              .map { |line| "\t\tfrom #{line}" }
                              .join($/)
  err_msg = "(#{caller_location}) #{exception}#{$/}  #{formatted_stack_trace}"
  Hpe3parSdk.logger.error(err_msg)
end
merge_hash(hash1, hash2) click to toggle source
# File lib/Hpe3parSdk/util.rb, line 14
def self.merge_hash(hash1, hash2)
  raise TypeError, 'hash1 is not a hash' unless hash1.class == Hash
  raise TypeError, 'hash2 is not a hash' unless hash2.class == Hash

  hash3 = hash2.merge(hash1)
  hash3
end