From d188600559b8678496932b575607c95fda06d654 Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Fri, 21 Jul 2023 14:28:49 +0530 Subject: [PATCH] fix: modify exception tracker to log even if sentry configured (#7563) Right now, if sentry is configured exception won't be logged. This results in the log management tool missing every error captured with ChatwootExceptionTracker. This change logs the exception, even if Sentry is configured or not. Fixes https://linear.app/chatwoot/issue/CW-2145/improve-logging-info-debug-trace --- lib/chatwoot_exception_tracker.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/chatwoot_exception_tracker.rb b/lib/chatwoot_exception_tracker.rb index e525f3e89..d2879a08c 100644 --- a/lib/chatwoot_exception_tracker.rb +++ b/lib/chatwoot_exception_tracker.rb @@ -12,11 +12,8 @@ class ChatwootExceptionTracker end def capture_exception - if ENV['SENTRY_DSN'].present? - capture_exception_with_sentry - else - Rails.logger.error @exception - end + capture_exception_with_sentry if ENV['SENTRY_DSN'].present? + Rails.logger.error @exception end private