-
Notifications
You must be signed in to change notification settings - Fork 640
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
While playing around today, I noticed an error can occur before an API request is made. It's only on an HTTP stream that we get the abort method (to close the connection), so we have to check that it's available to call first.
From lib/storage/file.js:
requestStream
.on('error', function(err) {
throughStream.destroy(err);
})
.on('response', function(res) {
throughStream.emit('response', res);
util.handleResp(null, res, null, onResponse);
})
.on('complete', function(res) {
util.handleResp(null, res, null, onComplete);
})
.pipe(throughStream)
.on('error', function() {
++ if (requestStream.abort) {
requestStream.abort();
++ }
requestStream.destroy();
});Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.