Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315564 - Confusing error message for file:// protocol
Summary: Confusing error message for file:// protocol
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.12   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-03 08:05 EDT by Dmitry Neverov CLA
Modified: 2011-03-14 11:42 EDT (History)
3 users (show)

See Also:


Attachments
possible fix (728 bytes, patch)
2010-06-03 08:07 EDT, Dmitry Neverov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Neverov CLA 2010-06-03 08:05:01 EDT
When I try to open transport for non-existing git repository using file protocol I get misleading error message:

org.eclipse.jgit.errors.NotSupportedException: URI not supported: /path/to/non-existing/repository.git
	at org.eclipse.jgit.transport.Transport.open(Transport.java:354)
	at org.eclipse.jgit.transport.Transport.open(Transport.java:137)
	at org.eclipse.jgit.transport.Transport.open(Transport.java:110)

Perhaps repository resolution should not be done in canHandle() method of org.eclipse.jgit.transport.TransportLocal and org.eclipse.jgit.transport.TransportBundleFile (patch for

TransportLocal is attached). In this case we will get more meaningfull error message:

org.eclipse.jgit.errors.TransportException: Remote does not have refs/heads/master available for fetch.
	at org.eclipse.jgit.transport.FetchProcess.expandSingle(FetchProcess.java:320)
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:131)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:109)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:814)
Comment 1 Dmitry Neverov CLA 2010-06-03 08:07:09 EDT
Created attachment 170940 [details]
possible fix
Comment 2 Stefan Lay CLA 2010-09-28 10:34:32 EDT
With this solution I get a strange error message for push: "file:///C:/path/to/non-existing/repository.git: Pipe closed." if there is no repository for this path.

Maybe we could throw in this case already a NotSupportedException in TransportLocal.canHandle with a more meaningful error message like "file:///C:/path/to/non-existing/repository.git does not exist"?
Comment 3 Dmitry Neverov CLA 2010-09-28 11:14:42 EDT
Sounds good for me
Comment 4 Dmitry Neverov CLA 2011-02-26 13:04:03 EST
Stefan, what do you think about this patch: http://egit.eclipse.org/r/2606 ?
Comment 5 Shawn Pearce CLA 2011-03-14 11:42:38 EDT
Fixed by commit 305a8ac45f350580957743b3b3aa4c4eca0a6396