Sha256: 4727ca22b11df144509ca7663f3096f37649cf33141e9043bd43d7a4c763ec54
Contents?: true
Size: 854 Bytes
Versions: 9
Compression:
Stored size: 854 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" Scrivito::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
9 entries across 9 versions & 1 rubygems