lib/roda/plugins/error_mail.rb in roda-3.37.0 vs lib/roda/plugins/error_mail.rb in roda-3.38.0
- old
+ new
@@ -69,10 +69,17 @@
end
subject = "#{email_opts[:prefix]}#{subject}"
format = lambda{|h| h.map{|k, v| "#{k.inspect} => #{v.inspect}"}.sort.join("\n")}
+ begin
+ params = request.params
+ params = (format[params] unless params.empty?)
+ rescue
+ params = 'Invalid Parameters!'
+ end
+
message = String.new
message << <<END
Path: #{request.path}
END
@@ -89,15 +96,15 @@
ENV:
#{format[env]}
END
- unless request.params.empty?
+ if params
message << <<END
Params:
-#{format[request.params]}
+#{params}
END
end
if env['rack.session']
message << <<END