Fix #297 - Provide better initialization errors

This commit is contained in:
Gideon Thomas 2014-11-16 00:23:43 -05:00
parent 1283535d75
commit 286074f519
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
*
@ -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;