-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
feat!: template exception #3561
Conversation
mkdir parents True
Co-authored-by: Jacob Coffee <[email protected]>
…itestar-org#3527) * Convert controllers to routers on registration
* chore(docs): updated example for flash messages * chore: remove redundant store config
Co-authored-by: Jacob Coffee <[email protected]> rm underscore fix/already-async .
Co-authored-by: euri10 <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3561 +/- ##
==========================================
- Coverage 98.25% 98.23% -0.03%
==========================================
Files 328 328
Lines 14870 14882 +12
Branches 2366 2367 +1
==========================================
+ Hits 14611 14619 +8
- Misses 117 120 +3
- Partials 142 143 +1 ☔ View full report in Codecov by Sentry. |
@JacobCoffee how could I ask for a review? I can not click and change "Reviewers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @Murtagy!
I'm afraid this will have to wait until 3.0, as it is a breaking change because it changes the exception type, which some users might rely on.
If you want, you can retarget this at the v3.0 branch
What is the exception that users could already handle? |
…tion' into feat/template-exception
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3561 |
@provinzkraut , I see that 2.9.1 is on the way de8f4a7 . What would it take to put this into 3.0 ? |
You are adding blanket exception handling here: litestar/litestar/response/template.py Lines 146 to 149 in bab28ab
If a user had previously implemented a subclass of Another scenario would be top-level exception handling for a specific exception thrown by the templating engine, for the same reasons.
Just rebase from the |
Closing this for now. @Murtagy if you're still interested in this feature, you can reopen a new PR against the |
Description
Added a wrapper around exceptions coming from templates.
The exceptions can be rather cryptic, so having a little more context around them is helpful.
So the core benefit of this PR is the change of
into
Which now points to exact template location. Woohoo!
I did not add any tests for these 🤷