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

Commit facf571

Browse files
authored
Merge pull request #205 from littleskunk/freespace
Invalid storage size print out missing bytes
2 parents f16a2bd + be92bc5 commit facf571

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
@@ -95,7 +95,8 @@ exports.validateAllocation = function(conf, callback) {
9595
}
9696

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

101102
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)