lib/eco/api/usecases/graphql/samples/location/command/service/tree_update.rb in eco-helpers-3.0.14 vs lib/eco/api/usecases/graphql/samples/location/command/service/tree_update.rb in eco-helpers-3.0.15

- old
+ new

@@ -19,20 +19,20 @@ def process with_error_handling do super end ensure - rescued { re_archive } unless error_raised? + rescued { re_archive } unless exception? rescued { email_digest('TagTree Update') } end # Before closing, run RE-ARCHIVE: those that where unarchived via archivedToken # that should remain archived. # @note this is an additional necessary step def re_archive return if simulate? - return if error_raised? + return if exception? stage = :rearchive nodes_diff_class.new( hash_list(current_tree), @@ -88,10 +88,14 @@ return if simulate? return if options.dig(:workflow, :no_email) digest_msgs = logger.cache.logs(level: %i[info error warn]) str_exception = exception ? " - Exception!" : '' + str_exception = " - Aborted!" if exiting? + subject = "#{config.active_enviro} - #{title}#{str_exception}" + + digest_msgs << "\n#{exception.patch_full_message(trace_count: 3)}" if exception session.mail(subject: subject, body: digest_msgs.join).tap do options.deep_merge!({worfklow: {no_email: true}}) end end