chore: Improve clarity of SSL_TYPE=self-signed error message (missing files) (#4658)

Removed ambiguity when an expected file to support this `SSL_TYPE` mode was missing. The error message is now dynamic so that it only displays what is missing, along with language that is more compatible to one vs multiple files.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
Copilot
2026-02-17 11:09:05 +13:00
committed by GitHub
parent 0cf3ead816
commit 1caedc0a40
2 changed files with 10 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ function dms_panic() {
;;
( 'no-file' ) # PANIC_INFO == <invalid filepath>
SHUTDOWN_MESSAGE="File ${PANIC_INFO} does not exist!"
SHUTDOWN_MESSAGE="Missing expected file(s): ${PANIC_INFO}"
;;
( 'misconfigured' ) # PANIC_INFO == <something possibly misconfigured, eg an ENV var>

View File

@@ -309,7 +309,15 @@ function _setup_ssl() {
_log 'trace' "SSL configured with 'self-signed' certificates"
else
_dms_panic__no_file "${SS_KEY} or ${SS_CERT} or ${SS_CA_CERT}" "${SCOPE_SSL_TYPE}"
local MISSING_FILES=()
[[ ! -f ${SS_KEY} ]] && MISSING_FILES+=("${SS_KEY}")
[[ ! -f ${SS_CERT} ]] && MISSING_FILES+=("${SS_CERT}")
[[ ! -f ${SS_CA_CERT} ]] && MISSING_FILES+=("${SS_CA_CERT}")
# Concatenate each element and delimit with ` + `:
local ERROR_CONTEXT
ERROR_CONTEXT=$(printf "'%s' + " "${MISSING_FILES[@]}" | sed 's/ + $//')
_dms_panic__no_file "${ERROR_CONTEXT}" "${SCOPE_SSL_TYPE}"
fi
;;