General Improvements: Skip invalid pages that fail to load
leandrocp opened this issue · 1 comments
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
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
Table name: beacon_failed_pages
page_id | reason |
---|---|
uuid | {exception, stack_trace } |
Having such feature allow us to display what caused the page to fail.
Related to #35 and BeaconCMS/beacon_live_admin#90