From f86487f742c34c7c57b98f7e3606af0d51e287db Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Mon, 30 Jun 2025 23:54:45 +0200 Subject: [PATCH] Fix exception reporter --- app/services/exception_reporter.rb | 2 +- app/services/users/import_data/trips.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/exception_reporter.rb b/app/services/exception_reporter.rb index a21a4aaa..667206a8 100644 --- a/app/services/exception_reporter.rb +++ b/app/services/exception_reporter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class ExceptionReporter - def self.call(exception, human_message = nil) + def self.call(exception, human_message = 'Exception reported') return unless DawarichSettings.self_hosted? Rails.logger.error "#{human_message}: #{exception.message}" diff --git a/app/services/users/import_data/trips.rb b/app/services/users/import_data/trips.rb index bbc8f556..d695479f 100644 --- a/app/services/users/import_data/trips.rb +++ b/app/services/users/import_data/trips.rb @@ -148,21 +148,21 @@ class Users::ImportData::Trips def validate_trip_name(trip_data) unless trip_data['name'].present? - ExceptionReporter.call(e, 'Failed to create trip: Validation failed: Name can\'t be blank') + Rails.logger.error 'Failed to create trip: Validation failed: Name can\'t be blank' return false end end def validate_trip_started_at(trip_data) unless trip_data['started_at'].present? - ExceptionReporter.call(e, 'Failed to create trip: Validation failed: Started at can\'t be blank') + Rails.logger.error 'Failed to create trip: Validation failed: Started at can\'t be blank' return false end end def validate_trip_ended_at(trip_data) unless trip_data['ended_at'].present? - ExceptionReporter.call(e, 'Failed to create trip: Validation failed: Ended at can\'t be blank') + Rails.logger.error 'Failed to create trip: Validation failed: Ended at can\'t be blank' return false end end