module Dapp::Helper::NetStatus

Public Class Methods

before_error_message(exception) click to toggle source
# File lib/dapp/helper/net_status.rb, line 18
def before_error_message(exception)
  (net_status(exception)[:data][:before_error_messages] || []).join("\n")
end
message(exception) click to toggle source
# File lib/dapp/helper/net_status.rb, line 9
def message(exception)
  net_status = net_status(exception)
  net_status[:message] || begin
    data = net_status[:data].reject {|k, _| k == :backtrace}
    data = nil if data.empty?
    [net_status[:error], [net_status[:context], net_status[:code]].compact.join('.'), data].compact.join(': ')
  end
end
net_status(exception) click to toggle source
# File lib/dapp/helper/net_status.rb, line 5
def net_status(exception)
  exception.net_status.net_status_normalize(context: exception.net_status.delete(:context))
end