you swapping error and data? it believe its quite common to do it like this, also amazon js example it using it this way: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DataPipeline.html