From: Ivan Frade Date: Thu, 6 Jun 2024 19:01:04 +0000 (-0700) Subject: RepoCommand: Add error to ManifestErrorException X-Git-Tag: v7.0.0.202409201410-m3~1^2^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4bc6eb8a70281b30e40ebe2fb12927ce2d2640df;p=jgit.git RepoCommand: Add error to ManifestErrorException RepoCommand wraps errors in the manifest in a ManifestErrorException with a fixed message ("Invalid manifest"). Callers like supermanifest plugin cannot return a meaningful error to the client without digging into the cause chain. Add the actual error message to the ManifestErrorException, so callers can rely on #getMessage() to see what happens. Change-Id: I18be17fb5e4aaaf4f11ebd627580a91fe330eaca (cherry picked from commit b41187429359cf9830fd34368d28a454653e187d) --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java index 3aaef387f9..9979664ceb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -255,7 +255,7 @@ public class RepoCommand extends GitCommand { @SuppressWarnings("serial") static class ManifestErrorException extends GitAPIException { ManifestErrorException(Throwable cause) { - super(RepoText.get().invalidManifest, cause); + super(RepoText.get().invalidManifest + " " + cause.getMessage(), cause); } }