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

Downgraded express-hbs errors to 400 #15864

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

ErisDS
Copy link
Member

@ErisDS ErisDS commented Nov 22, 2022

refs: https://github.com/TryGhost/Team/issues/2289 refs: TryGhost/express-hbs#161

  • Themes that resuse layouts as templates trigger horrible errors, which are thrown as 500s
  • But there's nothing the server is doing wrong, it's a theme user, so we downgrade these to 400s
  • There is more to do here to improve the errors shown, but this is just a first step to ensure that theme issues don't look like server failures

Verified

This commit was signed with the committer’s verified signature.
ErisDS Hannah Wolfe
refs: TryGhost/Product#2289
refs: TryGhost/express-hbs#161

- Themes that resuse layouts as templates trigger horrible errors, which are thrown as 500s
- But there's nothing the server is doing wrong, it's a theme user, so we downgrade these to 400s
- There is more to do here to improve the errors shown, but this is just a first step to ensure that theme issues don't look like server failures
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Base: 67.76% // Head: 67.76% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (6271750) compared to base (5457402).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15864      +/-   ##
==========================================
- Coverage   67.76%   67.76%   -0.01%     
==========================================
  Files        1620     1620              
  Lines      105114   105130      +16     
  Branches    14958    14959       +1     
==========================================
+ Hits        71231    71240       +9     
- Misses      32602    32610       +8     
+ Partials     1281     1280       -1     
Flag Coverage Δ
e2e-tests 76.59% <ø> (-0.01%) ⬇️
unit-tests 53.72% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ghost/mw-error-handler/lib/mw-error-handler.js 100.00% <100.00%> (ø)
...ata-generator/lib/tables/members-created-events.js 85.71% <0.00%> (-8.58%) ⬇️
...host/data-generator/lib/tables/members-products.js 97.14% <0.00%> (-2.86%) ⬇️
ghost/admin/app/components/gh-image-uploader.js 84.35% <0.00%> (-1.37%) ⬇️
ghost/core/core/server/services/mega/mega.js 60.49% <0.00%> (-0.54%) ⬇️
ghost/admin/app/controllers/offer.js 42.63% <0.00%> (-0.53%) ⬇️
ghost/core/core/server/models/user.js 87.56% <0.00%> (ø)
ghost/core/core/frontend/helpers/tiers.js 93.18% <0.00%> (ø)
ghost/core/core/server/models/settings.js 90.57% <0.00%> (ø)
ghost/core/core/frontend/helpers/post_class.js 89.74% <0.00%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ErisDS ErisDS merged commit 682f3a2 into TryGhost:main Nov 22, 2022
@ErisDS ErisDS deleted the downgrade-express-hbs branch November 22, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant