Add BetterErrors gem.
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -65,6 +65,8 @@ group :development do
|
||||
gem 'stackprof'
|
||||
gem 'flamegraph'
|
||||
gem 'memory_profiler'
|
||||
gem 'better_errors'
|
||||
gem 'binding_of_caller'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
|
||||
@@ -115,6 +115,12 @@ GEM
|
||||
aws-sigv4 (1.2.2)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
bcrypt (3.1.16)
|
||||
better_errors (2.9.1)
|
||||
coderay (>= 1.0.0)
|
||||
erubi (>= 1.0.0)
|
||||
rack (>= 0.9.0)
|
||||
binding_of_caller (1.0.0)
|
||||
debug_inspector (>= 0.0.1)
|
||||
bootsnap (1.5.1)
|
||||
msgpack (~> 1.0)
|
||||
builder (3.2.4)
|
||||
@@ -153,6 +159,7 @@ GEM
|
||||
crass (1.0.6)
|
||||
daemons (1.3.1)
|
||||
dante (0.2.0)
|
||||
debug_inspector (1.0.0)
|
||||
delayed_job (4.1.9)
|
||||
activesupport (>= 3.0, < 6.2)
|
||||
delayed_job_active_record (4.1.5)
|
||||
@@ -415,6 +422,8 @@ DEPENDENCIES
|
||||
addressable
|
||||
aws-sdk-sqs (~> 1)
|
||||
bcrypt
|
||||
better_errors
|
||||
binding_of_caller
|
||||
bootsnap
|
||||
builder
|
||||
capistrano (~> 3.10)
|
||||
|
||||
@@ -120,7 +120,7 @@ class ApplicationController < ActionController::Base
|
||||
when PG::ConnectionBad
|
||||
render_error_page(503, exception, message: "The database is unavailable. Try again later.")
|
||||
else
|
||||
raise exception if Danbooru.config.debug_mode
|
||||
raise exception if !Rails.env.production? || Danbooru.config.debug_mode
|
||||
render_error_page(500, exception)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,4 +63,7 @@ Rails.application.configure do
|
||||
|
||||
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||
# config.action_cable.disable_request_forgery_protection = true
|
||||
|
||||
BetterErrors::Middleware.allow_ip!(IPAddr.new("0.0.0.0/0"))
|
||||
BetterErrors::Middleware.allow_ip!(IPAddr.new("::/0"))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user