| Summary: | [repository] getting index file is guarded by a throwable | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Pascal Rapicault <pascal> | ||||
| Component: | p2 | Assignee: | Ian Bull <irbull> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | Flags: | pascal:
review+
dj.houghton: review+ |
||||
| Version: | 3.6 | ||||||
| Target Milestone: | 3.6 RC2 | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I did this so getting the index file would not cause any problems. I wanted to make the fetching of the index file as least disruptive as possible, and while I don't expect the transport to throw any exceptions, if it does, then we can consider the index file to be missing. Created attachment 167792 [details]
fix v.1
This removes the catch throwable, and refactors the code a bit. If the download failes (with an exception) it will be propagated up. If it fails with a status, then we just ignore the index file.
Pascal, feel free to review this and mark it RC1. If not, we can put it in 3.7. Pascal, This will fix the user cancel problem (since we won't eat the user cancelled exception). It would also be good to get this in before we fix bug 306816 as there will be considerable overlap. Ian you can start looking at bug #306816 assuming this patch will be in. (In reply to comment #5) > Ian you can start looking at bug #306816 assuming this patch will be in. I already put a patch on bug #306816. The fix is just to treat files differently. Patch released. |
I came across the following code in the AbstractRepositoryManager and wonder why can't we simply check the transport error rather than catching Throwable. // get the search order from the server, if it's available ByteArrayOutputStream index = new ByteArrayOutputStream(); LocationProperties locationProperties = null; try { getTransport().download(getIndexFile(location), index, monitor); } catch (Throwable e) { // If any exceptions are thrown, just ignore the index file }