Sha256: fb9ca6e6c4201de7f6ce68bcf13248c978df95a0cbd44fe04b9573257ab48675
Contents?: true
Size: 751 Bytes
Versions: 6
Compression:
Stored size: 751 Bytes
Contents
module Hyperstack class Hotloader module AddErrorBoundry def self.included(base) base.after_error do |*err| @err = err Hyperstack::Component.force_update! end base.define_method :render do @err ? parse_display_and_clear_error : top_level_render end end def parse_display_and_clear_error e = @err[0] component_stack = @err[1]['componentStack'].split("\n ") @err = nil display_error(e, component_stack) end def display_error(e, component_stack) DIV do DIV { "Uncaught error: #{e}" } component_stack.each do |line| DIV { line } end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems