diff options
Diffstat (limited to 'app/services/test_hooks')
-rw-r--r-- | app/services/test_hooks/base_service.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/test_hooks/base_service.rb b/app/services/test_hooks/base_service.rb index b41a9959c13..3f2949a53ba 100644 --- a/app/services/test_hooks/base_service.rb +++ b/app/services/test_hooks/base_service.rb @@ -16,9 +16,16 @@ module TestHooks trigger_key = hook.class.triggers.key(trigger.to_sym) return error('Testing not available for this hook') if trigger_key.nil? || data.blank? + return error(data[:error]) if data[:error].present? hook.execute(data, trigger_key, force: true) + rescue ArgumentError => e + error(e.message) + end + + def error(message) + ServiceResponse.error(message: message) end end end |