Basically, instead of passing through native aws-sdk functions, we would write small wrappers. For example, from index.js:
// this is what we do now
var dyno = {
putItem: docClient.put.bind(docClient)
};
// we could, instead
var dyno = {
putItem: function(params, callback) {
return docClient.put(params, callback)
.on('retry', function(response) {
if (!response.error) return;
response.error.amzId = response.httpResponse.headers['x-amz-request-id'];
response.error.amzId2 = response.httpResponse.headers['x-amz-id-2'];
});
}
}
Dyno could insure that an error object always comes with request ids attached if this doesn't get implemented upstream.
Basically, instead of passing through native aws-sdk functions, we would write small wrappers. For example, from index.js:
cc @willwhite