Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route and Resource Loading: Support error pages #137

Closed
leandrocp opened this issue Feb 17, 2023 · 0 comments · Fixed by #331
Closed

Route and Resource Loading: Support error pages #137

leandrocp opened this issue Feb 17, 2023 · 0 comments · Fixed by #331
Assignees
Labels
enhancement New feature or improvement help wanted Looking for contributors
Milestone

Comments

@leandrocp
Copy link
Contributor

leandrocp commented Feb 17, 2023

Phoenix Endpoint renders templates for errors given the Endpoint :render_errors is properly set, and Beacon integrates with this mechanism by raising custom exceptions with a proper :plug_status.

Currently the only supported way to render these error page is by defining them in the host application, but we want to allow users to write the templates for 4xx, 5xx errors at runtime.

Tasks

Beacon

  • Add table beacon_error_pages
  • Add schema ErrorPage with at least :template and :status fields. Status must be one of the 4xx and 5xx as listed at https://github.com/elixir-plug/plug/blob/main/lib/plug/conn/status.ex#L8
  • Functions in Beacon.Content to manage these error pages. A good example is Implement PageEventHandlers #328
  • Change the install script to modify the Endpoint :render_errors config value to html: BeaconWeb.ErrorHTML
  • Compile a "error module" per site containing all these error templates in Beacon.Loader. Similar to how Layouts are loaded.
  • In BeaconWeb.ErrorHTML is must pattern match some private assign to find the source site and call the correct render function from the error module for that site. This module acts as a proxy. That's the part we're unsure and should do some research.

Beacon LiveAdmin

@AZholtkevych AZholtkevych moved this to Todo in Beacon Feb 27, 2023
@AZholtkevych AZholtkevych modified the milestone: Version 0.1.0 Feb 27, 2023
@leandrocp leandrocp added enhancement New feature or improvement question labels Feb 28, 2023
@AZholtkevych AZholtkevych changed the title Support error pages Core -> Route and Resource Loading: Support error pages Apr 28, 2023
@AZholtkevych AZholtkevych added help wanted Looking for contributors app:core and removed question labels Apr 28, 2023
@AZholtkevych AZholtkevych mentioned this issue May 1, 2023
29 tasks
@AZholtkevych AZholtkevych mentioned this issue Jun 9, 2023
18 tasks
@APB9785 APB9785 self-assigned this Aug 16, 2023
@AZholtkevych AZholtkevych moved this from Todo to In Progress in Beacon Aug 17, 2023
@APB9785 APB9785 mentioned this issue Aug 24, 2023
@AZholtkevych AZholtkevych added this to the Version 0.1.0 milestone Sep 15, 2023
@AZholtkevych AZholtkevych assigned leandrocp and unassigned APB9785 Sep 22, 2023
@AZholtkevych AZholtkevych moved this from In Progress to Done in Beacon Oct 19, 2023
@AZholtkevych AZholtkevych changed the title Core -> Route and Resource Loading: Support error pages Route and Resource Loading: Support error pages Oct 23, 2023
@AZholtkevych AZholtkevych mentioned this issue Apr 21, 2024
45 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement help wanted Looking for contributors
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants