title: retry promise with new parmeters
body: <p>I have a promise function, _checkCookie that checks for a cookie and resolves if found and rejects with false if not found. </p>
  
  <p>The function takes one parameter, the cookie name. </p>
  
  <p>I'm now trying to resolve the username by checking multiple different cookies. As in, check for cookie A, if not there check for cookie B and so on. </p>
  
  <p>I'm stuck with getting the checkCookie function to rerun from within its own catch statement. is there a way to have checkCookie try with each potential cookie name without having to recall it in each .catch() block? </p>
  
  <pre><code>potentialCookies = ['cookieA','cookieB','cookieC']
  
   function _checkCookie(cookieName) {
      return new Promise((resolve, reject) =&gt; {
          const cname = `${cookieName}=`;
          const ca = document.cookie.split(";");
          for (let i = 0; i &lt; ca.length; i++) {
              let c = ca[i];
              while (c.charAt(0) === " ") {
                  c = c.substring(1, c.length);
              }
              if (c.indexOf(cname) === 0) {
                  resolve(c.substring(cname.length, c.length));
              }
          }
          reject(false)
      });
  }
  </code></pre>
  
  <p>Here's one option I tried unsuccessfully</p>
  
  <pre><code>        _checkCookie("CookieA")
              .catch(e =&gt; {
                  throw e
              })
              .catch(e =&gt; {
                  _checkCookie("CookieB")
                  console.warn(e, '2')
                  throw e
              }).
              catch(e =&gt; {
                _checkCookie("CookieC")
                  console.warn(e, '3')
                  throw e
              })
  </code></pre>