diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-03-20 15:16:58 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-03-20 15:18:05 +0100 |
| commit | 61b3b1840568b223baad08da1eb9a1fb5d6e7f91 (patch) | |
| tree | 08029e37929cce1abb919628308c1ec88564a44e | |
| parent | a2cb87afcbc89d1f8e770c26121a75d9c1654458 (diff) | |
solver3: Avoid empty error message in evaluation crash report
whoopsie does not accept empty values
| -rw-r--r-- | apt-private/private-install.cc | 9 | ||||
| -rwxr-xr-x | test/integration/test-solver3-evaluation | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index cf92f91ad..f1211d25e 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -124,9 +124,12 @@ static void WriteApportReport(pkgCacheFile &Cache, std::string &title, std::vect << "Title: " << title << "\n" << "SourcePackage: apt\n"; - crash << "ErrorMessage:\n"; - for (auto &error : errors) - crash << " " << error << "\n"; + if (not errors.empty()) + { + crash << "ErrorMessage:\n"; + for (auto &error : errors) + crash << " " << error << "\n"; + } std::ifstream toCopy(edspDump.Name()); std::ostringstream readStream; diff --git a/test/integration/test-solver3-evaluation b/test/integration/test-solver3-evaluation index b05e7cb9b..c01ec9608 100755 --- a/test/integration/test-solver3-evaluation +++ b/test/integration/test-solver3-evaluation @@ -30,7 +30,6 @@ Date: Sun Mar 9 00:08:41 2025 Package: apt Title: Failure: The 3.0 solver produced a worse result SourcePackage: apt -ErrorMessage: AptSolverDump: $(cat rootdir/var/log/apt/edsp.log.zst | base64 | sed 's#^# #')" cat rootdir/var/crash/apt-edsp.$(id -u).crash |
