Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 132094 Details for
Bug 271681
[transport][ui] Details error message not shown in the UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Surface Errors from Metadata Repositories
SurfaceErrors-Metadata.patch (text/plain), 5.59 KB, created by
Matthew Piggott
on 2009-04-16 11:32:15 EDT
(
hide
)
Description:
Surface Errors from Metadata Repositories
Filename:
MIME Type:
Creator:
Matthew Piggott
Created:
2009-04-16 11:32:15 EDT
Size:
5.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.updatesite >Index: src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java,v >retrieving revision 1.33 >diff -u -r1.33 UpdateSite.java >--- src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java 15 Apr 2009 02:26:51 -0000 1.33 >+++ src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java 16 Apr 2009 15:04:18 -0000 >@@ -161,15 +161,15 @@ > // The only thing needed is to translate the error code ARTIFACT_NOT_FOUND to > // REPOSITORY_NOT_FOUND as the download does not know what the file represents. > // >- // TODO: ? Tests dictate that REPOSITORY_NOT_FOUND is the correct response to >- // issues like "unknown host", "malformed url" - it is almost impossible to differentiate >- // between "not found" and "error while reading something found" at this point. >- // int code = transferResult.getCode(); >- MultiStatus ms = new MultiStatus(Activator.ID, // >- ProvisionException.REPOSITORY_NOT_FOUND, >- // (code == ProvisionException.ARTIFACT_NOT_FOUND || code == ProvisionException.REPOSITORY_NOT_FOUND ? ProvisionException.REPOSITORY_NOT_FOUND : ProvisionException.REPOSITORY_FAILED_READ), // >- new IStatus[] {transferResult}, // >- NLS.bind(Messages.ErrorReadingSite, location), null); >+ IStatus ms = null; >+ if (transferResult.getException() instanceof FileNotFoundException) >+ ms = new MultiStatus(Activator.ID, // >+ ProvisionException.REPOSITORY_NOT_FOUND, >+ // (code == ProvisionException.ARTIFACT_NOT_FOUND || code == ProvisionException.REPOSITORY_NOT_FOUND ? ProvisionException.REPOSITORY_NOT_FOUND : ProvisionException.REPOSITORY_FAILED_READ), // >+ new IStatus[] {transferResult}, // >+ NLS.bind(Messages.ErrorReadingSite, location), null); >+ else >+ ms = transferResult; > throw new ProvisionException(ms); > > } finally { >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java,v >retrieving revision 1.36 >diff -u -r1.36 MetadataRepositoryManagerTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 13 Apr 2009 21:24:55 -0000 1.36 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 16 Apr 2009 15:04:20 -0000 >@@ -124,13 +124,13 @@ > try { > factory.load(location, 0, new NullProgressMonitor()); > } catch (ProvisionException e) { >- assertEquals(ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode()); >+ assertEquals(ProvisionException.REPOSITORY_INVALID_LOCATION, e.getStatus().getCode()); > } > factory = new UpdateSiteMetadataRepositoryFactory(); > try { > factory.load(location, 0, new NullProgressMonitor()); > } catch (ProvisionException e) { >- assertEquals(ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode()); >+ assertEquals(ProvisionException.REPOSITORY_INVALID_LOCATION, e.getStatus().getCode()); > } > } > >#P org.eclipse.equinox.p2.metadata.repository >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java,v >retrieving revision 1.13 >diff -u -r1.13 CacheManager.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java 15 Apr 2009 04:07:04 -0000 1.13 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java 16 Apr 2009 15:04:25 -0000 >@@ -121,7 +121,6 @@ > lastModifiedRemote = getTransport().getLastModified(jarLocation, submonitor.newChild(1)); > if (lastModifiedRemote <= 0) > LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Server returned lastModified <= 0 for " + jarLocation)); //$NON-NLS-1$ >- > } catch (Exception e) { > // not ideal, just skip the jar on error, and try the xml instead - report errors for > // the xml. >@@ -154,7 +153,12 @@ > } catch (AuthenticationFailedException e) { > throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), e)); > } catch (CoreException e) { >- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, repositoryLocation), e)); >+ IStatus status = e.getStatus(); >+ if (status == null) >+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, repositoryLocation), e)); >+ else if (status.getException() instanceof FileNotFoundException) >+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, status.getMessage(), null)); >+ throw new ProvisionException(status); > > } > // There is an xml, and it should be used - cache is stale if it is jar based or
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
john.arthorne
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 271681
:
131341
|
132091
| 132094