Sha256: d7e4c352080ab3d30e023771da2962d8284562584bd09b4a4328cb4dc0ea73b4
Contents?: true
Size: 462 Bytes
Versions: 8
Compression:
Stored size: 462 Bytes
Contents
module Rack class ErrorHandling def initialize(app, &block) @app = app end def call(env) # save original env orig_env = env.dup begin return @app.call(env) rescue => error begin # reset env to original since it could have been changed env.clear env.merge!(orig_env) # set error so app can handle it env["app.error"] = error return @app.call(env) rescue raise end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems