-
Notifications
You must be signed in to change notification settings - Fork 352
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
Display more informative error information in TimeoutError response body #1460
Conversation
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.
Thank you for this @caesarsol, I believe you'll need to run npm run format
to fix the linting errors on CI
Sorry about that! I'll do whenever I find the time. |
Rewrote commit! |
Solved conflict and linting problem |
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.
@caesarsol sorry for the late follow up on this.
I made some additional fixes:
- When
err
is not a lambda error, it is a string, not an error instance - changed the code accordingly. - When the error comes from lambda it was already logged by
winston
so no need toconsole.log
it again (it is logged as JSON as the moment but that's another issue). - Extracted the custom validation Netlify CLI does on lambda response to a separate function.
Please let me know what you think.
- Summary
Closes #1459, problem described with detail in relative issue.
There are more elegant ways to solve this, but I would delay them to later times. This is kind of a quick but solid workaround.
I also removed the colored
◈
from the response body (ANSI chars), and changed the console log message to include the same exact failure message of the response: "Function invocation failed" (was slightly different, creating confusion).- Test plan
Tested as described in #1459 with a TimeoutError, and by manually causing a
new Error
in the code.Knowing what else can cause an error would help in triggering other possible error types.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
Thanks! ;)