code: function compile(config) {
      let compiler;
      try {
          compiler = webpack(config);
      }
      catch (error) {
          console.error('Failed to compile.', error);
          process.exitCode = 1;
      }
      return compiler;
  }
docs: Webpack compile in a try-catch