Closed dotnetCarpenter closed 7 years ago
My use-case is that I need to test if the argument to the callbacks is a NativeStorageError.
function readFile(fileName, callback) { fileSystem.getItem( fileName, normalizeCallback(callback, fileName, actionEnum.read), // success normalizeCallback(callback, fileName, actionEnum.read)) // failure } function normalizeCallback(callback, fileName, action) { return function(e) { var err if(e instanceof Error) { err = { name: fileName, action: getName(actionEnum, action), toString: function toString() { return getName(errorEnum, e.code) } } callback(err, null) } else { callback(null, fileFactory(fileName, e == null ? '' : e.data)) } } }
PR with a fix will come soon
My use-case is that I need to test if the argument to the callbacks is a NativeStorageError.
PR with a fix will come soon