driftyco/ng-cordova — pull request #335 by mzbyszynski (2014-09-24 04:13:08+00:00)
Title: improved error handling and refactored some common code in $cordovaFile

This is a subset of the changes from PR #306, in particular:

1. Improved error handling in all ```$cordovaFile``` methods. Some of the file system api calls were being invoked without an error callback, which could cause the promise returned by the enclosing ```$cordovaFile``` method to hang and never get resolved (see #160).
2. Replaced ```console.log``` with injected ```$log.log()``` for consistency with angular dependency injection pattern. I wanted to change it to ```$log.warn()```, since it is a warning logged from a deprecated method, but I didn't want to change the functionality of anything that wasn't a bug in this PR so I just left it.
3. Refactored some duplicate code into some reusable private functions.

All feedback & suggestions welcome!