From 4e1454ded6e2fcf6cb789c004756883c3ea5f77e Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Wed, 30 May 2012 02:07:25 +0200 Subject: Git API does not declare GitAPIException call() and related cleanups All commands should throw a GitAPIException so new exceptions can be added without breaking the builds of old code, i.e. anyone that calls a Git API should catch GitAPIException and not just the currently known exceptions. Now the only checked exceptions on Git API calls are GitException and subclasses of it. New checked exceptions that are subclasses of GitException may be added without breaking the API. Javadoc for GitAPIException is declared on GitCommand and inherited to subclasses. JGitInternalException is not explicitly documented anymore. Unfortunately this change itself breaks the API. The intention is that it shall be possible to add new checked subclasses of GitAPIException without breaking the API. Bug: 366914 EGit-Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5 Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5 Signed-off-by: Matthias Sohn --- org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitCloneTask.java | 2 +- org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit.ant') diff --git a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitCloneTask.java b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitCloneTask.java index f40b7b1e23..8d12ce3ad4 100644 --- a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitCloneTask.java +++ b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitCloneTask.java @@ -110,7 +110,7 @@ public class GitCloneTask extends Task { try { clone.setURI(uri).setDirectory(destination).setBranch(branch).setBare(bare); clone.call(); - } catch (RuntimeException e) { + } catch (Exception e) { log("Could not clone repository: " + e, e, Project.MSG_ERR); throw new BuildException("Could not clone repository: " + e.getMessage(), e); } diff --git a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java index 7b1610eebe..efdab42aaa 100644 --- a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java +++ b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java @@ -91,7 +91,7 @@ public class GitInitTask extends Task { InitCommand init = Git.init(); init.setBare(bare).setDirectory(destination); init.call(); - } catch (JGitInternalException e) { + } catch (Exception e) { throw new BuildException("Could not initialize repository", e); } } -- cgit v1.2.3