From 94b23d46b7036741e5280ff9b5a07400dc221136 Mon Sep 17 00:00:00 2001 From: Ari Karim Date: Tue, 27 May 2025 14:15:39 +0300 Subject: [PATCH] Enhance error handling in manager.rb by logging error messages and classes during transition failures --- lib/workflower/manager.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/workflower/manager.rb b/lib/workflower/manager.rb index 5d6f02b..c7c5ddb 100644 --- a/lib/workflower/manager.rb +++ b/lib/workflower/manager.rb @@ -61,7 +61,9 @@ module Workflower @calling_model.assign_attributes flow.updateable_attributes(@calling_model) flow.call_after_transition(@calling_model) true - rescue Exception + rescue Exception => e + puts "ERROR MESSAGE: #{e.message}" + puts "ERROR CLASS: #{e}" @calling_model.errors.add(@calling_model.workflower_state_column_name, :transition_faild) false end