Populate the error informations in response body when transmitting back execution results to the callback url when there are errors.
Add information for which function caused the errors.
Motivation and Context
When there is error in http.NewRequest(http.MethodPost, functionURL, bytes.NewReader(req.Body)), the functionResult is empty, thus the client has noway to know what happens, and could not execute any post-error-handling process.
Also it is possible that some functions would share the same X-Callback-Url and they are intended to do some parsing job for the response body instead of depending on different callback url. However when error happens, the response body is empty, the client has no way to know which function caused the error.
How Has This Been Tested?
Hard code an err and check received response from the client side's logs.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Signed-off-by: yubol yubol@splunk.com
Description
Motivation and Context
http.NewRequest(http.MethodPost, functionURL, bytes.NewReader(req.Body))
, the functionResult is empty, thus the client has noway to know what happens, and could not execute any post-error-handling process.X-Callback-Url
and they are intended to do some parsing job for the response body instead of depending on different callback url. However when error happens, the response body is empty, the client has no way to know which function caused the error.How Has This Been Tested?
Hard code an err and check received response from the client side's logs.
Types of changes
Checklist:
git commit -s