title: "else not running executing in function(err)
body: <p>I'm trying to console log whether or not my function is running successfully, or it encounters an error.</p>
  
  <pre><code>var gui = require('nw.gui'); 
  var fs  = require('fs');
  
  onload = function() {
      //console.log(gui.App.argv);
      console.log("onload() is running - from &lt;saveFile.js&gt;")
      var outputPath = gui.App.dataPath + "\\saves\\" + "content.txt";
      var content = "hello world";
      fs.writeFileSync(outputPath, JSON.stringify(content), "utf8", function(err) {
          if(err) {
              console.log(err);
          }
          else{ 
  
                  console.log('saved in ' + outputPath);
          }
      });
  
  
  };
  </code></pre>
  
  <p>it logs the error if encountered, but the else statement never executes.</p>