title: No error message from curl
body: <p>I would like to know why the following bash script swallows the error message.</p>
  
  <pre><code>#!/bin/sh
  
  set -eu
  
  LATEST=$(curl -s https://api.github.com/repos/dnote-io/cli/tags | grep -Eo '"name": "v\d*\.\d*\.\d*",'  | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2)
  
  if [ -z $LATEST ]; then
      echo "Error fetching latest version. Please try again."
      exit 1
  fi
  
  ....
  </code></pre>
  
  <p>Basically, the script fetches something and assigns the result to a variable <code>LATEST</code>. But when the fetching goes wrong, the script does not print the actual error message from <code>curl</code>.</p>
  
  <p>Any ideas or suggestions on how to not ignore the error?</p>