mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Fix exception reporter
This commit is contained in:
parent
c75e037a5a
commit
f86487f742
2 changed files with 4 additions and 4 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue