title: Catching execSync erross
body: <p>I'm using <code>execSync</code> to run a <code>soffice</code> command. The issue I'm having is when an error is thrown <code>execSync</code> just logs the error to the console there is no way of catching it. I've tried using a <code>try</code> <code>catch</code> statement but it still just logs the error to the console.</p>
  
  <pre><code>function convertToPdf(filepath, destpath) {
    var cmd = 'sofice command';
  
    try {
      var res = execSync(cmd, { encoding: 'utf8' });
    } catch (e) {
      console.log("Errors:", e);
    } 
  
    console.log("res:", res);
  }
  
  convertToPdf("test.docx");
  </code></pre>
  
  <p>I run this and get this back:</p>
  
  <pre><code>Error: source file could not be loaded
  res:
  </code></pre>
  
  <p>Notice how my catch statement is never logged even though an error was clearly thrown but another <code>Error:</code> message is logged automatically because I'm not logging that.</p>