Skip to content

Commit

Permalink
Improve file store error when cache disabled and sync api used
Browse files Browse the repository at this point in the history
Closes #2406
  • Loading branch information
knolleary committed Feb 7, 2020
1 parent 3db5f92 commit 7d32636
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ LocalFileSystem.prototype.get = function(scope, key, callback) {
return this.cache.get(scope,key,callback);
}
if(typeof callback !== "function"){
throw new Error("Callback must be a function");
throw new Error("File Store cache disabled - only asynchronous access supported");
}
var storagePath = getStoragePath(this.storageBaseDir ,scope);
loadFile(storagePath + ".json").then(function(data){
Expand Down Expand Up @@ -304,7 +304,7 @@ LocalFileSystem.prototype.set = function(scope, key, value, callback) {
}, this.flushInterval);
}
} else if (callback && typeof callback !== 'function') {
throw new Error("Callback must be a function");
throw new Error("File Store cache disabled - only asynchronous access supported");
} else {
self.writePromise = self.writePromise.then(function() { return loadFile(storagePath + ".json") }).then(function(data){
var obj = data ? JSON.parse(data) : {}
Expand Down

0 comments on commit 7d32636

Please sign in to comment.