PerlDancer / PerlDancer/Dancer2

Fix error template logic in core Error object

Open
#945 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Beginner Suitable
Dominant language
Perl
Stars
604
Forks
288
Avg merge
1d 5h
Merged PRs (30d)
5

Description

@mickeyn and I were delving into Dancer2::Core::Error and #565 and we have the following conclusions (brought up by a lot of anger and sitting for a few hours on this shitty class):

  • error_template should take precedence over rendering files (both the public/ and the views/ files) because this means the user wants this specific template to be rendered in case of errors.
  • In addition, we need to introduce a default_error_template which means, "you already tried to find a template for this code and an error page in public/, now please render this generic (default) error template for me".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Dancer2::Core::Error and read the related discussion in #565. Trace how error_template currently competes with rendering files in public/ and views/, then define the expected role of default_error_template. Done means the stated precedence is implemented and the generic fallback is used only after the specific template lookups fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.