Sha256: b6d54a3106bd67175dcc478f4b2f48e5784d113d9adcff2a6d98744430502efd
Contents?: true
Size: 740 Bytes
Versions: 9
Compression:
Stored size: 740 Bytes
Contents
# frozen_string_literal: true module MtkFramework module ActiveInteractionConcerns module Interruptable extend ActiveSupport::Concern include ::MtkFramework::ActiveInteractionConcerns::Rescuable included do class ApplicationInterrupt < StandardError; end rescue_from ApplicationInterrupt do raise unless errors.any? end end def interrupt_execute!(*args) if args.any? if args[0].is_a? ActiveModel::Errors errors.merge!(args[0]) else errors.add(*args) end end raise 'interrupt_execute! called without error' if errors.empty? raise ApplicationInterrupt end end end end
Version data entries
9 entries across 9 versions & 1 rubygems