diff --git a/pkg/sosreport/sosreport.jsx b/pkg/sosreport/sosreport.jsx index bc822dde6d95..51c0a697820d 100644 --- a/pkg/sosreport/sosreport.jsx +++ b/pkg/sosreport/sosreport.jsx @@ -177,7 +177,8 @@ function sosCreate(args, setProgress, setError, setErrorDetail) { }); task.catch(error => { - setError(error.toString()); + console.error(JSON.stringify(error)); + setError(error.toString() || _("sos report failed")); setErrorDetail(output); }); diff --git a/test/verify/check-sosreport b/test/verify/check-sosreport index ac341107027d..30c01d467c13 100755 --- a/test/verify/check-sosreport +++ b/test/verify/check-sosreport @@ -107,6 +107,18 @@ only-plugins=release,date,host,cgroups,networking b.click("#sos-remove-dialog button:contains(Delete)") testlib.wait(lambda: m.execute(f"! test -f /var/tmp/{base_report_gpg} && echo yes")) + # error reporting + self.write_file("/usr/local/bin/sos", """#!/bin/sh +echo "EssOhEss is kaputt" >&2 +exit 1""", perm="755") + b.click("button:contains('Run report')") + b.wait_visible("#sos-dialog") + b.click("#sos-dialog button:contains(Run report)") + b.wait_in_text("#sos-dialog .pf-v5-c-alert", "sos report failed") + b.wait_in_text("#sos-dialog .pf-v5-c-alert", "EssOhEss is kaputt") + b.click("#sos-dialog button:contains(Cancel)") + b.wait_not_present("#sos-dialog") + self.allow_journal_messages('.*comm="sosreport".*') def testWithUrlRoot(self):