diff --git a/app/controllers/lookbook/application_controller.rb b/app/controllers/lookbook/application_controller.rb index 50f123146..ccee434d0 100644 --- a/app/controllers/lookbook/application_controller.rb +++ b/app/controllers/lookbook/application_controller.rb @@ -57,6 +57,8 @@ def raise_not_found(message = "Page not found") end def handle_error(err) + raise err if Lookbook.config.preview_disable_error_handling + @error = err.is_a?(Lookbook::Error) ? err : Lookbook::Error.new(original: err) @status_code = get_status_code(err) diff --git a/config/app.yml b/config/app.yml index bcaa6c2c5..0590e1177 100644 --- a/config/app.yml +++ b/config/app.yml @@ -23,6 +23,7 @@ shared: preview_disable_action_view_annotations: true preview_type_default: view_component preview_sort_scenarios: false + preview_disable_error_handling: false page_collection_label: "Pages" page_nav_filter: false diff --git a/lib/lookbook/stores/config_store.rb b/lib/lookbook/stores/config_store.rb index 930880003..5c5c6e403 100644 --- a/lib/lookbook/stores/config_store.rb +++ b/lib/lookbook/stores/config_store.rb @@ -59,6 +59,10 @@ def highlighter_options=(options = nil) store[:highlighter_options].merge!(options.to_h) end + def preview_disable_error_handling=(value) + store[:preview_disable_error_handling] = value + end + def ui_theme=(name) name = name.to_s if Theme.valid_theme?(name)