Fix ```writeFile``` silent fail

Writefile was missing an error callback. This was causing it to fail but give no feedback.
Merge pull request #192 from SidFerreira/patch-1

Fix writeFile silent fail