Skip to content

Instantly share code, notes, and snippets.

@ericboehs

ericboehs/better_errors.rb

Last active Dec 12, 2015
Embed
What would you like to do?
# config/initializers/better_errors.rb
module BetterErrors
def self.allow_remote
@allow_remote
end
def self.allow_remote=(allow_remote=false)
@allow_remote = allow_remote
end
class Middleware
def call(env)
if local_request?(env) || BetterErrors.allow_remote || ENV['BE_ALLOW_REMOTE']
better_errors_call env
else
@app.call env
end
end
end
end
BetterErrors.allow_remote = true if defined? BetterErrors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment