From 286074f519dc70eb0595e9a08be4d65cbc348ac4 Mon Sep 17 00:00:00 2001 From: Gideon Thomas Date: Sun, 16 Nov 2014 00:23:43 -0500 Subject: [PATCH] Fix #297 - Provide better initialization errors --- src/filesystem/interface.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/filesystem/interface.js b/src/filesystem/interface.js index e9e54e1..7d8fa2e 100644 --- a/src/filesystem/interface.js +++ b/src/filesystem/interface.js @@ -39,6 +39,13 @@ function maybeCallback(callback) { }; } +// Default callback that logs an error if passed in +function defaultCallback(err) { + if(err) { + console.error('Filer error: ', err); + } +} + /** * FileSystem * @@ -69,7 +76,7 @@ function maybeCallback(callback) { */ function FileSystem(options, callback) { options = options || {}; - callback = callback || nop; + callback = callback || defaultCallback; var flags = options.flags; var guid = options.guid ? options.guid : defaultGuidFn;