Sha256: ab2edb7a1320c96fe6f5cf15dc876163c4d0ee2e1e4cafc500d7e360313124fe

Contents?: true

Size: 742 Bytes

Versions: 104

Compression:

Stored size: 742 Bytes

Contents

module ReactOnRails
  class PrerenderError < RuntimeError
    # err might be nil if JS caught the error
    def initialize(component_name: nil, err: nil, props: nil,
                   js_code: nil, console_messages: nil)
      message = "ERROR in SERVER PRERENDERING\n"
      if err
        message << <<-MSG
Encountered error: \"#{err}\"
        MSG
        backtrace = err.backtrace.join("\n")
      else
        backtrace = nil
      end
      message << <<-MSG
when prerendering #{component_name} with props: #{props}
js_code was:
#{js_code}
      MSG

      if console_messages
        message << <<-MSG
console messages:
#{console_messages}
        MSG
      end

      super([message, backtrace].compact.join("\n"))
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
react_on_rails-6.8.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.8.0 lib/react_on_rails/prerender_error.rb
react_on_rails-6.7.2 lib/react_on_rails/prerender_error.rb
react_on_rails-6.7.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.6.0 lib/react_on_rails/prerender_error.rb
react_on_rails-6.6.0.alpha.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.5.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.5.0 lib/react_on_rails/prerender_error.rb
react_on_rails-6.4.2 lib/react_on_rails/prerender_error.rb
react_on_rails-6.5.0.beta.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.4.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.4.0 lib/react_on_rails/prerender_error.rb
react_on_rails-6.3.5 lib/react_on_rails/prerender_error.rb
react_on_rails-6.3.4 lib/react_on_rails/prerender_error.rb
react_on_rails-6.3.3 lib/react_on_rails/prerender_error.rb
react_on_rails-6.3.2 lib/react_on_rails/prerender_error.rb
react_on_rails-6.3.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.3.0 lib/react_on_rails/prerender_error.rb
react_on_rails-6.2.1 lib/react_on_rails/prerender_error.rb
react_on_rails-6.2.1.rc.3 lib/react_on_rails/prerender_error.rb