The original error needs to be kept separately from any potential errors that
might occur while processing the onError hooks.
This was already done in one place where err2 was being used.
If all onError callbacks complete successfully then async.eachSeries calls its
callback without an error value.
One way to repro this problem is to set up a beforeRequest hook that sets
request.url = null. Artillery then errors in a spot where it tries to access
the original error but actually accesses the non-existent async error.
NOTE: It does seem like something ought to pay attention to any async errors. That
might be good to tackle in a separate PR though?
The original error needs to be kept separately from any potential errors that might occur while processing the onError hooks.
This was already done in one place where
err2
was being used.If all onError callbacks complete successfully then
async.eachSeries
calls its callback without an error value.One way to repro this problem is to set up a
beforeRequest
hook that setsrequest.url = null
. Artillery then errors in a spot where it tries to access the original error but actually accesses the non-existent async error.NOTE: It does seem like something ought to pay attention to any async errors. That might be good to tackle in a separate PR though?