mirror of
https://github.com/ditkrg/workflower.git
synced 2026-01-22 14:17:11 +00:00
Refactor error logging in manager.rb to always log transition errors if logger is present, simplifying the conditional check.
This commit is contained in:
parent
99752aec39
commit
44018a3016
@ -63,9 +63,8 @@ module Workflower
|
|||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
# if the log level is set to debug, we want to log the error
|
# if the log level is set to debug, we want to log the error
|
||||||
logger = Workflower.configuration.logger
|
logger = Workflower.configuration.logger
|
||||||
if logger.present? && logger.level == Logger::DEBUG
|
logger.debug("Error during transition: #{e.message}") if logger.present?
|
||||||
logger.debug("Error during transition: #{e.message}")
|
|
||||||
end
|
|
||||||
@calling_model.errors.add(@calling_model.workflower_state_column_name, :transition_faild)
|
@calling_model.errors.add(@calling_model.workflower_state_column_name, :transition_faild)
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user