Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343577

Summary: Let pull fail gracefully when offline
Product: [Technology] EGit Reporter: Benjamin Muskalla <b.muskalla>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn
Version: unspecified   
Target Milestone: 1.1-M1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Benjamin Muskalla CLA 2011-04-21 12:16:46 EDT
1. be offline
2. Invoke Pull

Error dialog pops up with JGitInternalException. We should rather tell the user that there was something wrong with the remote or the user has no connection.

org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of fetch command
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:145)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:217)
at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:82)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:104)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:115)
at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.run(PullOperationUI.java:90)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.errors.TransportException: git://egit.eclipse.org/egit.git: unknown host
at org.eclipse.jgit.transport.TransportGitAnon.openConnection(TransportGitAnon.java:139)
at org.eclipse.jgit.transport.TransportGitAnon$TcpFetchConnection.<init>(TransportGitAnon.java:170)
at org.eclipse.jgit.transport.TransportGitAnon.openFetch(TransportGitAnon.java:111)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:125)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1062)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:136)
... 8 more
Comment 1 Benjamin Muskalla CLA 2011-08-17 09:14:50 EDT
Created attachment 201642 [details]
screenshot

Just happened again, pretty annoying as you think something bad happened.
Comment 2 Matthias Sohn CLA 2011-08-17 10:21:58 EDT
Pushed patch for review: http://egit.eclipse.org/r/4021
Comment 3 Benjamin Muskalla CLA 2011-08-18 17:40:45 EDT
Merged as 80201587deb426165eefc9b20dfa4fa8e9f482eb.

Thanks Matthias!