Exception: NetStatus::Exception

Inherits:
Exception
  • Object
show all
Defined in:
lib/net_status/exception.rb

Defined Under Namespace

Modules: Mixin

Instance Method Summary collapse

Constructor Details

#initialize(net_status = {}) ⇒ Exception

Returns a new instance of Exception.



3
4
5
6
7
# File 'lib/net_status/exception.rb', line 3

def initialize(net_status={})
  @net_status = net_status
  @net_status[:error] ||= :error
  super()
end

Instance Method Details

#messageObject



16
17
18
# File 'lib/net_status/exception.rb', line 16

def message
  net_status_short.to_s
end

#net_statusObject



9
10
11
12
13
14
# File 'lib/net_status/exception.rb', line 9

def net_status
  @net_status.dup.tap do |res|
    res[:data] = (res[:data] || {}).dup
    res[:data][:backtrace] ||= self.backtrace
  end
end