Method: StandardError#initialize_original
- Defined in:
- lib/coaster/core_ext/standard_error/raven.rb
#initialize_original ⇒ StandardError
Returns a new instance of StandardError.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/coaster/core_ext/standard_error/raven.rb', line 4 def initialize( = nil, cause = $!) @fingerprint = Coaster.default_fingerprint.dup = {} @level = 'error' @attributes = HashWithIndifferentAccess.new @tkey = nil case when Exception msg = set_backtrace(.backtrace) when StandardError @fingerprint = .fingerprint = . @level = .level @tkey = .tkey @attributes = .attributes msg = set_backtrace(.backtrace) when Hash then hash = .with_indifferent_access rescue msg = hash.delete(:m) msg = hash.delete(:msg) || msg msg = hash.delete(:message) || msg @fingerprint = hash.delete(:fingerprint) || hash.delete(:fingerprints) = hash.delete(:tags) || hash.delete(:tag) @level = hash.delete(:level) || hash.delete(:severity) || @level @tkey = hash.delete(:tkey) msg = cause. if msg.nil? && cause @attributes.merge!(hash) when String then msg = when FalseClass, NilClass then msg = '' else msg = end @fingerprint = [] unless @fingerprint.is_a?(Array) = {} unless .is_a?(Hash) msg ||= self.class.title super(msg) end |