code: function stopSeries(err) {
        if(err instanceof Error || (typeof err === 'object' && (err.code || err.error))) {
          stopErr = err;
        }
        isStopped = true;
      }
docs: The function can be called inside a promise call, that will stop the series chain.