Sha256: 96997057b2cbb45f2c030ff3d634a52a7871f79b8a15170c7e41253bd08184fa

Contents?: true

Size: 914 Bytes

Versions: 3

Compression:

Stored size: 914 Bytes

Contents

module Hyperstack
  module Internal
    module Component
      class RescueMetaWrapper
        include Hyperstack::Component

        param :children_elements

        render do
          @ChildrenElements.call
        end
      end

      class RescueWrapper
        class << self
          attr_accessor :after_error_args
        end

        include Hyperstack::Component

        param :child
        param :children_elements

        render do
          RescueMetaWrapper(children_elements: @ChildrenElements)
        end

        after_error do |error, info|
          args = RescueWrapper.after_error_args || [error, info]
          found, * = @Child.run_callback(:__hyperstack_component_rescue_hook, found, *args) { |a| a }
          unless found
            RescueWrapper.after_error_args = args
            raise error
          end
          @Child.force_update!
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hyper-component-1.0.alpha1.5 lib/hyperstack/internal/component/rescue_wrapper.rb
hyper-component-1.0.alpha1.4 lib/hyperstack/internal/component/rescue_wrapper.rb
hyper-component-1.0.alpha1.3 lib/hyperstack/internal/component/rescue_wrapper.rb