artilleryio / artillery-core

artillery-core - deprecated
Mozilla Public License 2.0
29 stars 104 forks source link

Separate async error from original error in onError handling #204

Closed jordan-brough closed 7 years ago

jordan-brough commented 7 years ago

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?

hassy commented 7 years ago

Good catch, thanks @jordan-brough