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

Commit be92bc5

Browse files
committed
Invalid storage size print out missing bytes
1 parent 7499057 commit be92bc5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ exports.validateAllocation = function(conf, callback) {
9898
}
9999

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

104105
return callback(null);

test/utils.unit.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ describe('module:utils', function() {
183183
}, function(err) {
184184
getFreeSpace.restore();
185185
getDirectorySize.restore();
186-
expect(err.message).to.equal('Invalid storage size');
186+
expect(err.message).to.equal(
187+
'Invalid storage size: 1024 bytes missing');
187188
done();
188189
});
189190
});

0 commit comments

Comments
 (0)