code: function handleError(reject) {
    return (e) => {
      // prevent global error throw https://bugzilla.mozilla.org/show_bug.cgi?id=872873
      if (typeof e.preventDefault === 'function') e.preventDefault()
      reject(e.target.error)
    }
  }
docs: Helper to handle errors and call `reject`.
  
  @param {Function} reject - from Promise constructor
  @return {Function}