lib/midori/sandbox.rb in em-midori-0.2.4 vs lib/midori/sandbox.rb in em-midori-0.3.0
- old
+ new
@@ -2,11 +2,11 @@
# Sandbox for global error capture
class Midori::Sandbox
class << self
def class_initialize
@handlers = Hash.new
- @handlers[Midori::Exception::InternalError] = proc {|e| Midori::Response.new(500, {}, "#{e.inspect} #{e.backtrace}")}
- @handlers[Midori::Exception::NotFound] = proc {|_e| Midori::Response.new(404, {}, '404 Not Found')}
+ @handlers[Midori::Exception::InternalError] = proc {|e| Midori::Response.new(status: 500, body: "#{e.inspect} #{e.backtrace}")}
+ @handlers[Midori::Exception::NotFound] = proc {|_e| Midori::Response.new(status: 404, body: '404 Not Found')}
end
# Add a rule to Sandbox
# @param [Class] class_name the class to capture
# @param [Proc] block what to do when captured