Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #205 from littleskunk/freespace
Browse files Browse the repository at this point in the history
Invalid storage size print out missing bytes
  • Loading branch information
aleitner committed Jul 24, 2017
2 parents f16a2bd + be92bc5 commit facf571
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ exports.validateAllocation = function(conf, callback) {
}

if (allocatedSpace > free + usedSpaceBytes) {
return callback(new Error('Invalid storage size'));
return callback(new Error('Invalid storage size: '+
-(free + usedSpaceBytes - allocatedSpace) +' bytes missing'));
}

return callback(null);
Expand Down
3 changes: 2 additions & 1 deletion test/utils.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ describe('module:utils', function() {
}, function(err) {
getFreeSpace.restore();
getDirectorySize.restore();
expect(err.message).to.equal('Invalid storage size');
expect(err.message).to.equal(
'Invalid storage size: 1024 bytes missing');
done();
});
});
Expand Down

0 comments on commit facf571

Please sign in to comment.