Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Kinzler2011-02-10 06:04:43 -0500
committerMatthias Sohn2011-02-10 07:38:53 -0500
commit226a7f50cdbff206855633bf85ed318375e95df4 (patch)
treef1cb2312585a8867e1623e51b546e351d6144e0e
parent84d9259d621842a36d3bc0c583cd43b0bcbd6fe3 (diff)
downloadegit-226a7f50cdbff206855633bf85ed318375e95df4.tar.gz
egit-226a7f50cdbff206855633bf85ed318375e95df4.tar.xz
egit-226a7f50cdbff206855633bf85ed318375e95df4.zip
Better Exception handling in Fetch and Push Operations
Currently, a NPE is logged when fetch or push fails since the operation returns null as result in this case. Bug: 336646 (not full resolution, but mentioned there) Change-Id: If29240874f2ce246f597ee6fdb9ba4d2accb772e Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushOperationUI.java8
2 files changed, 12 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java
index 186153590..5352c1912 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java
@@ -134,8 +134,12 @@ public class FetchOperationUI {
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
- FetchResultDialog.show(repository, op.getOperationResult(),
- sourceString);
+ if (event.getResult().isOK())
+ FetchResultDialog.show(repository, op.getOperationResult(),
+ sourceString);
+ else
+ Activator.handleError(event.getResult().getMessage(), event
+ .getResult().getException(), true);
}
});
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushOperationUI.java
index 52e7e3525..9938cd97f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushOperationUI.java
@@ -135,8 +135,12 @@ public class PushOperationUI {
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
- PushResultDialog.show(repository, op.getOperationResult(),
- destinationString);
+ if (event.getResult().isOK())
+ PushResultDialog.show(repository, op.getOperationResult(),
+ destinationString);
+ else
+ Activator.handleError(event.getResult().getMessage(), event
+ .getResult().getException(), true);
}
});
}

Back to the top