lib/softwear/error_catcher.rb in softwear-lib-3.1.5 vs lib/softwear/error_catcher.rb in softwear-lib-3.3.5

- old
+ new

@@ -39,14 +39,19 @@ def filter_params(params) new_hash = {} params.each do |key, value| new_value = value - case key.to_s - when /cc_number/ then new_value = "<FILTERED>" - when /cc_cvc/ then new_value = "<FILTERED>" - when /password/ then new_value = "<FILTERED>" + case value + when Hash + new_value = filter_params(value) + else + case key.to_s + when /cc_number/ then new_value = "<FILTERED>" + when /cc_cvc/ then new_value = "<FILTERED>" + when /password/ then new_value = "<FILTERED>" + end end new_hash[key] = new_value end new_hash @@ -54,14 +59,23 @@ def gather_additional_info JSON.pretty_generate(filter_params(params)) + "|||" + instance_variables .reject { |v| /^@_/ =~ v.to_s || %i(@view_renderer @output_buffer @view_flow @error).include?(v) } - .map { |v| "#{v}: #{instance_variable_get(v).inspect}" } + .map { |v| "#{v}: #{instance_variable_get(v).inspect rescue '(ERROR)'}" } .join("|||") end def layout_for_error - current_user ? 'application' : 'no_overlay' + user = try(:current_user) || @current_user + partner = Figaro.env.partner_namespace + + if user + "application" + elsif !partner.nil? && request.url.include?(partner) + "partners/application" + else + "no_overlay" + end end end end