Expose `AjaxController` errors in dev envirnoments

This commit is contained in:
Karina Kwiatek 2022-06-13 23:17:09 +02:00 committed by Karina Kwiatek
parent 0fe06e6423
commit 37732ff926
1 changed files with 10 additions and 8 deletions

View File

@ -6,16 +6,18 @@ class AjaxController < ApplicationController
respond_to :json respond_to :json
rescue_from(StandardError) do |e| unless Rails.env.development?
Sentry.capture_exception(e) rescue_from(StandardError) do |e|
Sentry.capture_exception(e)
@response = { @response = {
success: false, success: false,
message: "Something went wrong", message: "Something went wrong",
status: :err status: :err
} }
return_response return_response
end
end end
rescue_from(KeyError) do |e| rescue_from(KeyError) do |e|