Sha256: 07bc33ba3ca791d6db8be6dc40b8ae168594a9bb32a78fdbfd4e5ce142e73cc5

Contents?: true

Size: 904 Bytes

Versions: 3

Compression:

Stored size: 904 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)
          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.8 lib/hyperstack/internal/component/rescue_wrapper.rb
hyper-component-1.0.alpha1.7 lib/hyperstack/internal/component/rescue_wrapper.rb
hyper-component-1.0.alpha1.6 lib/hyperstack/internal/component/rescue_wrapper.rb