Method: FBCLI.koala_error_str

Defined in:
lib/fbcli/api.rb

.koala_error_str(e) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/fbcli/api.rb', line 18

def self.koala_error_str(e)
  str = "Koala #{e.fb_error_type}"
  str << " (code #{e.fb_error_code.to_s +
           (e.fb_error_subcode.nil? ? "" : ", subcode: " + e.fb_error_subcode.to_s)})"
  str << " HTTP status: #{e.http_status}" unless e.http_status.nil?
  str << "\n  #{e.fb_error_user_msg.nil? ? e.fb_error_message : e.fb_error_user_msg}"
  str << " (FB trace id: #{e.fb_error_trace_id})"

  str
end