crash_sender: include verbose curl output in error logs

BUG=None
TEST=Manual
TEST=`cbuildbot {arm,amd64,x86}-generic-full` pass

Change-Id: I7ee8f98aa1721d50bb8b86fd84b50d9432eaaa9d
Reviewed-on: https://chromium-review.googlesource.com/198682
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/crash_sender b/crash_sender
index 9dcf346..565d949 100755
--- a/crash_sender
+++ b/crash_sender
@@ -437,7 +437,7 @@
   local curl_stderr="${TMP_DIR}/curl_stderr"
 
   set +e
-  curl "${url}" ${proxy:+--proxy "$proxy"} \
+  curl "${url}" -v ${proxy:+--proxy "$proxy"} \
     --capath "${RESTRICTED_CERTIFICATES_PATH}" --ciphers HIGH \
     -F "prod=${product}" \
     -F "ver=${version}" \
@@ -456,7 +456,7 @@
   set -e
 
   if [ ${curl_result} -eq 0 ]; then
-    local id="$(cat ${report_id})"
+    local id="$(cat "${report_id}")"
     local product_name
     local timestamp="$(date +%s)"
     case ${product} in
@@ -479,7 +479,8 @@
       "${timestamp}" "${id}" "${product_name}" >> "${CHROME_CRASH_LOG}"
     lecho "Crash report receipt ID ${id}"
   else
-    lecho "Crash sending failed with: $(cat ${curl_stderr})"
+    lecho "Crash sending failed with exit code ${curl_result}: " \
+      "$(cat "${curl_stderr}")"
   fi
 
   rm -f "${report_id}"