From 37732ff9267945459d42804125287729b207fb95 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Mon, 13 Jun 2022 23:17:09 +0200 Subject: [PATCH] Expose `AjaxController` errors in dev envirnoments --- app/controllers/ajax_controller.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/ajax_controller.rb b/app/controllers/ajax_controller.rb index 9d072c7c..114d02a4 100644 --- a/app/controllers/ajax_controller.rb +++ b/app/controllers/ajax_controller.rb @@ -6,16 +6,18 @@ class AjaxController < ApplicationController respond_to :json - rescue_from(StandardError) do |e| - Sentry.capture_exception(e) + unless Rails.env.development? + rescue_from(StandardError) do |e| + Sentry.capture_exception(e) - @response = { - success: false, - message: "Something went wrong", - status: :err - } + @response = { + success: false, + message: "Something went wrong", + status: :err + } - return_response + return_response + end end rescue_from(KeyError) do |e|