openfaas / nats-queue-worker

Queue-worker for OpenFaaS with NATS Streaming
https://docs.openfaas.com/reference/async/
MIT License
128 stars 59 forks source link

Populate the error information when post request got errors #28

Closed lybroman closed 2 years ago

lybroman commented 6 years ago
  1. Populate the error informations in response body when transmitting back execution results to the callback url when there are errors.
  2. Add information for which function caused the errors.

Signed-off-by: yubol yubol@splunk.com

Description

  1. Populate the error informations in response body when transmitting back execution results to the callback url when there are errors.
  2. Add information for which function caused the errors.

Motivation and Context

  1. 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.
  2. 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

Checklist:

alexellis commented 4 years ago

Hi @lybroman sorry that we missed this PR. Are you able to rebase it and give some testing instruction please? cc @viveksyngh