Merge pull request #326 from gideonthomas/issue297

Fix #297 - Provide better initialization errors
This commit is contained in:
Alan K 2014-12-03 00:30:39 -05:00
commit e39129a7f4
1 changed files with 8 additions and 1 deletions

View File

@ -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 * FileSystem
* *
@ -69,7 +76,7 @@ function maybeCallback(callback) {
*/ */
function FileSystem(options, callback) { function FileSystem(options, callback) {
options = options || {}; options = options || {};
callback = callback || nop; callback = callback || defaultCallback;
var flags = options.flags; var flags = options.flags;
var guid = options.guid ? options.guid : defaultGuidFn; var guid = options.guid ? options.guid : defaultGuidFn;