lib/eco/api/usecases/graphql/helpers/base/error_handling.rb in eco-helpers-3.0.10 vs lib/eco/api/usecases/graphql/helpers/base/error_handling.rb in eco-helpers-3.0.11

- old
+ new

@@ -5,10 +5,14 @@ attr_reader :exception private + def exception_already_captured?(err) + err == exception + end + def interrupted?(err = exception) interrupt_errors.any? {|klass| err.is_a?(klass)} end def error_raised? @@ -17,10 +21,13 @@ def rescued yield rescue StandardError => err self.exception ||= err - log(:error) { err.patch_full_message } + + unless exception_already_captured?(err) + log(:error) { err.patch_full_message } + end end def with_error_handling @exception = nil yield