AjaxController: also rescue from StandardError

This commit is contained in:
Georg Gadinger 2020-04-29 19:54:43 +02:00
parent 781a4ba8b4
commit d492cd34f6
1 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,18 @@ class AjaxController < ApplicationController
respond_to :json
rescue_from(StandardError) do |e|
NewRelic::Agent.notice_error(e)
@response = {
success: false,
message: "Something went wrong",
status: :err
}
return_response
end
rescue_from(ActiveRecord::RecordNotFound) do |e|
NewRelic::Agent.notice_error(e)