diff --git a/lib/manager/VirtualStoredFSManager.js b/lib/manager/VirtualStoredFSManager.js index 32151844..d8c898b7 100644 --- a/lib/manager/VirtualStoredFSManager.js +++ b/lib/manager/VirtualStoredFSManager.js @@ -84,10 +84,8 @@ var SimpleVirtualStoredContentManager = (function (_super) { }; SimpleVirtualStoredContentManager.prototype._allocate = function (options, _callback) { var callback = function (_1, _2) { return process.nextTick(function () { return _callback(_1, _2); }); }; - if (!this.initialized) { - callback(new Error('SimpleVirtualStoredContentManager not initialized'), null); - return; - } + if (!this.initialized) + throw new Error('SimpleVirtualStoredContentManager not initialized'); var uid = (++this.cid).toString(16); fs.open(path.join(this.storeFolderPath, uid), 'w+', function (e, fd) { if (e) diff --git a/src/manager/VirtualStoredFSManager.ts b/src/manager/VirtualStoredFSManager.ts index 2686a7f8..3bd9973b 100644 --- a/src/manager/VirtualStoredFSManager.ts +++ b/src/manager/VirtualStoredFSManager.ts @@ -116,10 +116,7 @@ export class SimpleVirtualStoredContentManager extends VirtualStoredContentManag const callback = (_1, _2) => process.nextTick(() => _callback(_1, _2)); if(!this.initialized) - { - callback(new Error('SimpleVirtualStoredContentManager not initialized'), null); - return; - } + throw new Error('SimpleVirtualStoredContentManager not initialized'); const uid = (++this.cid).toString(16);