Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a59e11e authored by Dan Colish's avatar Dan Colish Committed by ChromeOS Commit Bot
Browse files

crash: do not call list-proxies if it does not exist.

Additionally, this adds logging for list-proxies call failures.

BUG=chromium:396033
TEST=unittests, test_that logging_UserCrash

CQ-DEPEND=CL:275076

Change-Id: I0515e75476bdc7a0ace8ebc8318e82c337a87374
Reviewed-on: https://chromium-review.googlesource.com/275077


Reviewed-by: default avatarMike Frysinger <vapier@chromium.org>
Commit-Queue: Daniel Colish <colish@chromium.org>
Tested-by: default avatarDaniel Colish <colish@chromium.org>
parent f3caa5a2
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -419,7 +419,18 @@ send_crash() {
  # double-quotes are necessary due to a bug in dash with the "local"
  # builtin command and values that have spaces in them (see
  # "https://bugs.launchpad.net/ubuntu/+source/dash/+bug/139097").
  local proxy="`${LIST_PROXIES} -quiet "${url}" | head -1`"
  if [ -f "${LIST_PROXIES}" ]; then
    local proxy ret
    proxy=$("${LIST_PROXIES}" --quiet "${url}")
    ret=$?
    if [ ${ret} -ne 0 ]; then
      proxy=''
      lecho -psyslog.warn \
        "Listing proxies failed with exit code ${ret}"
    else
      proxy=$(echo "${proxy}" | head -1)
    fi
  fi
  # if a direct connection should be used, unset the proxy variable.
  [ "${proxy}" = "direct://" ] && proxy=
  local report_id="${TMP_DIR}/report_id"