Module: NetStatus::Exception::Mixin

Defined in:
lib/net_status/exception.rb

Instance Method Summary collapse

Instance Method Details

#net_statusObject



21
22
23
# File 'lib/net_status/exception.rb', line 21

def net_status
  { error: :error, code: :exception, message: self.message, data: { backtrace: self.backtrace } }
end

#net_status_shortObject



25
26
27
28
29
30
31
32
# File 'lib/net_status/exception.rb', line 25

def net_status_short
  net_status.dup.tap do |res|
    if res[:data]
      res[:data] = res[:data].dup
      res[:data].delete(:backtrace)
    end
  end
end