title: How to pipe a default file on node request error?
body: <p>I'm using nodejs with the <a href="https://github.com/request/request" rel="nofollow noreferrer">request</a> package.</p>
  
  <p><strong>Situation:</strong> </p>
  
  <ol>
  <li>My frontend sends a file request to my node server through a HTTP GET</li>
  <li>The server check if the user is authenticated</li>
  <li><p>The server requests the file on AWS S3 like so:</p>
  
  <pre><code>request(req.query.url)
     .on('error', (e) =&gt; {
      // Some code here?
      res.sendFile(path.join(__dirname, '../assets/favicon.png'))
     })
     .pipe(res)
  </code></pre></li>
  </ol>
  
  <p><strong>Problem</strong>: Sometimes it doesn't find the file or can't connect to AWS S3 or whatever the error is, I would like to send  a default file if that happens. How could I achieve this? </p>