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

Improve Serverless Error Messaging #2083

Closed
zachleat opened this issue Nov 12, 2021 · 3 comments
Closed

Improve Serverless Error Messaging #2083

zachleat opened this issue Nov 12, 2021 · 3 comments
Labels
feature: 🏙 serverless Eleventy Serverless

Comments

@zachleat
Copy link
Member

Not quite good enough, here!

https://contrast-11ties.netlify.app/contrast/?foreground=%23ffffff&background=NOVALUE

{
  "error": "Couldn’t find any generated output from Eleventy (URL path parameters: {})."
}

via https://twitter.com/m_andrasch/status/1459074004707426308

@zachleat zachleat added the feature: 🏙 serverless Eleventy Serverless label Nov 12, 2021
@zachleat
Copy link
Member Author

For future me: we should solve this in a better way upstream in the toJSON (and related) calls to show error information?

Things to think about:

  • toJSON returns an array at the top level. I wish it used { results: [] } instead which would allow for { error: {} }—we may need a better way around this.
  • We may need to be careful about being too open about error messaging in serverless mode, which may have implications if we console.log the full error stack to the end user.

@vnourdin
Copy link

Hi, is there any workaround to send custom errors from rendering to final user ?

Currently, I raise an error from some filters/globals with custom message and statusCode field, but it is caught and replaced by "Having trouble rendering njk template ..." before reaching the .catch which follows elev.getOutput() and thus my users ever see a 500 without details.

@zachleat
Copy link
Member Author

zachleat commented Apr 9, 2024

Stale per #3074.

@zachleat zachleat closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: 🏙 serverless Eleventy Serverless
Projects
None yet
Development

No branches or pull requests

2 participants