Skip to content

Commit

Permalink
code 911
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Nov 25, 2014
1 parent e7168e9 commit e8764df
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ File.prototype.copy = function(destination, callback) {
* piped to a writable stream or listened to for 'data' events to read a file's
* contents.
*
* In the unlikely event there is a mismatch between what you downloaded and the
* version in your Bucket, your error handler will receive an error with code
* 911. If you receive this error, the best recourse is to try downloading the
* file again.
*
* @example
* //-
* // <h4>Downloading a File</h4>
Expand Down Expand Up @@ -274,11 +279,14 @@ File.prototype.createReadStream = function() {
if (that.metadata.md5Hash === localMd5Hash) {
throughStream.emit('complete');
} else {
var error = new Error([
'The downloaded data did not match the data from the server. ',
'To be sure the content is the same, you should download the ',
'file again.'
].join(''));
var error = new Error({
code: 911,
message: [
'The downloaded data did not match the data from the server.',
'To be sure the content is the same, you should download the',
'file again.'
].join(' ')
});

throughStream.emit('error', error);
}
Expand Down

0 comments on commit e8764df

Please sign in to comment.