-
Notifications
You must be signed in to change notification settings - Fork 62
fix: log CloudEvent function errors to stderr #132
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
Conversation
CloudEvent functions currently return 500 when an error is returned, but do not do anything with the error message. This logs the error message to stderr so it is not lost. Unlike Background Functions, the error message is NOT included in the response body though. Also, add fields for checking stderr to the unit tests.
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.
Requesting changes with one comment.
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.
1 comment
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.
I find it odd that we're checking the stderr string "Function error: TestEventFunction(erroring function): this error should fire"
for just this one tc / possible function error, but lgtm other than that.
Most of the other test cases do not return an error, so there is no stderr to check for. Note, that particular test case has a function that returns an error with the error message being "TestEventFunction(erroring function): this error should fire". |
The line Resolves to the HTTP body response: "Function error: TestEventFunction(erroring function): this error should fire") Right? |
Yes. That test case has always returned that string in the response body, it just wasn't being checked due to an if-condition that skipped checking the response body if |
CloudEvent functions currently return 500 when an error is returned, but
do not do anything with the error message. This logs the error message
to stderr so it is not lost.
Unlike Background Functions, the error message is NOT included in the
response body though.
Also, add fields for checking stderr to the unit tests.