Bug 375820 - TransportException brings no public info on the cause
Summary: TransportException brings no public info on the cause
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL: https://git.eclipse.org/r/#/c/5819/
Whiteboard:
Keywords:
Depends on:
Blocks: 374204
  Show dependency tree
 
Reported: 2012-04-02 05:09 EDT by Tomasz Zarna CLA
Modified: 2012-05-04 07:42 EDT (History)
2 users (show)

See Also:


Attachments
mylyn/context/zip (3.41 KB, application/octet-stream)
2012-04-02 05:10 EDT, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2012-04-02 05:09:26 EDT
When a TransportException [1] is thrown from TransportHttp.connect(String) there is no way to determine the cause other than checking the message the exception brings. As long as JGitText was public this could be (arguably) acceptable, however once JGitText became an internal class [2] this is a no-go for clients like Orion (see bug 374204).

There are at least two ways of fixing this:
* Provide subclasses of TransportException. This one seems to fit the current JGit design better, there are already 5 subclasses of TransportException.
* Introduce an enum with exception codes.

[1] org.eclipse.jgit.errors.TransportException (not org.eclipse.jgit.api.errors.TE)
[2] 95d311f8886f42f31a4475f84aa23c6345ab7059
Comment 1 Tomasz Zarna CLA 2012-04-02 05:10:04 EDT
Created attachment 213435 [details]
mylyn/context/zip
Comment 2 Tomasz Zarna CLA 2012-05-04 07:42:12 EDT
(In reply to comment #0)
> * Provide subclasses of TransportException.

Pushed to Gerrit as https://git.eclipse.org/r/#/c/5819/