title: what to return when terminating the process with process.exit(1);
body: <p>I would like to replace my <code>throw new Error('Unknown command.')</code> with a log statement and <code>process.exit(1);</code>. Given this example code</p>
  
  <pre><code>private getCommandByName = (name: string): ICommand =&gt; {
      try {
          // try to fetch a value from a map
          return &lt;ICommand&gt; this.commands.get(name);
      } catch (error) {
          console.log('Unknown command.');
          process.exit(1);
      }
  }
  </code></pre>
  
  <p>I get this error</p>
  
  <blockquote>
    <p>Function lacks ending return statement and return type does not
    include 'undefined'.</p>
  </blockquote>
  
  <p>To fix it I would have to throw an exception. What do I have to return when I want to terminate the process?</p>