General Improvements: Skip invalid pages that fail to load #367
Labels
area:loader
Related to app and resource loading
enhancement
New feature or improvement
roadmap
Priority issues that will be released in the short term
We do validate templates and resources as much as possible but that's not enough since we expose a callback to customize template loading that may fail due to user errors, causing crashes that take the whole site down. Since the pages are lazy loaded, we can't perform checks early in the pipeline being open to such risk.
Now that we support error pages, we'll skip loading such pages and let beacon present a 404 error instead.
So instead of just raising when loading a page at
beacon/lib/beacon/loader.ex
Line 448 in cbe3bf7
it will insert a new record in a ETS table storing the page id as key and both the stack trace and exception as value.
This ETS has to be created when the app starts, similar to
beacon/lib/beacon/application.ex
Line 19 in 4d29550
Having such feature allow us to display what caused the page to fail.
Related to #35 and BeaconCMS/beacon_live_admin#90
The text was updated successfully, but these errors were encountered: