Sha256: 9ecb300a409178768aa707c7f044754c141b2617e2fc2b2d0c9ef9adc44b3803
Contents?: true
Size: 844 Bytes
Versions: 92
Compression:
Stored size: 844 Bytes
Contents
module Scrivito class ErroredWidgetTag < BaseWidgetTag attr_reader :error def initialize(view, widget, options) @error = options.fetch(:error) super end def content if view.controller.respond_to?(:on_scrivito_widget_error, true) view.controller.__send__(:on_scrivito_widget_error, widget, error) else handle_render_error(widget, error) end end private def description_for_editor "Error in #{widget.class.description_for_editor}" end def handle_render_error(widget, error) message = "Rendering widget with ID #{widget.id} and obj_class #{widget.obj_class} for "\ "obj with ID #{widget.obj.id} failed" Warning.error(message, error) "We're sorry, but something went wrong. "\ "If you are the application owner check the logs for more information." end end end
Version data entries
92 entries across 92 versions & 1 rubygems