Considering that error causes are now part of the JS standard, using that instead would be beneficial, no? This is the approach eg I took with https://github.com/voxpelli/pony-cause