View | Details | Raw Unified | Return to bug 267887
Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java (-12 / +17 lines)
Lines 10-17 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.equinox.internal.p2.ui.model;
11
package org.eclipse.equinox.internal.p2.ui.model;
12
12
13
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
14
15
import java.net.URI;
13
import java.net.URI;
16
import org.eclipse.core.runtime.*;
14
import org.eclipse.core.runtime.*;
17
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
15
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
Lines 22-27 Link Here
22
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository;
23
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager;
24
import org.eclipse.equinox.internal.provisional.p2.query.IQueryable;
22
import org.eclipse.equinox.internal.provisional.p2.query.IQueryable;
23
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
25
import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
24
import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
26
import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages;
25
import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages;
27
import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
26
import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
Lines 108-123 Link Here
108
				// If repository could not be found, report to the user, but only once.
107
				// If repository could not be found, report to the user, but only once.
109
				// If the user refreshes the repositories, new elements will be created and
108
				// If the user refreshes the repositories, new elements will be created and
110
				// then a failure would be reported again on the next try.
109
				// then a failure would be reported again on the next try.
111
				if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND) {
110
				switch (e.getStatus().getCode()) {
112
					if (!alreadyReportedNotFound) {
111
					case ProvisionException.REPOSITORY_FAILED_READ :
113
						// report the status, not the exception, to the user because we
112
					case ProvisionException.REPOSITORY_FAILED_AUTHENTICATION :
114
						// do not want to show them stack trace and exception detail.
113
					case ProvisionException.REPOSITORY_INVALID_LOCATION :
115
						ProvUI.reportNotFoundStatus(location, e.getStatus(), StatusManager.SHOW);
114
					case ProvisionException.REPOSITORY_NOT_FOUND :
116
						alreadyReportedNotFound = true;
115
						if (!alreadyReportedNotFound) {
117
					}
116
							// report the status, not the exception, to the user because we
118
				} else
117
							// do not want to show them stack trace and exception detail.
119
					// handle other exceptions the normal way
118
							ProvUI.reportNotFoundStatus(location, e.getStatus(), StatusManager.SHOW);
120
					handleException(e, NLS.bind(ProvUIMessages.MetadataRepositoryElement_RepositoryLoadError, location));
119
							alreadyReportedNotFound = true;
120
						}
121
						break;
122
					default :
123
						// handle other exceptions the normal way
124
						handleException(e, NLS.bind(ProvUIMessages.MetadataRepositoryElement_RepositoryLoadError, location));
125
				}
121
			} catch (OperationCanceledException e) {
126
			} catch (OperationCanceledException e) {
122
				// Nothing to report
127
				// Nothing to report
123
			}
128
			}
(-)src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java (-6 / +11 lines)
Lines 10-17 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.equinox.internal.provisional.p2.ui.dialogs;
11
package org.eclipse.equinox.internal.provisional.p2.ui.dialogs;
12
12
13
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
14
15
import java.lang.reflect.InvocationTargetException;
13
import java.lang.reflect.InvocationTargetException;
16
import java.net.URI;
14
import java.net.URI;
17
import java.util.ArrayList;
15
import java.util.ArrayList;
Lines 25-30 Link Here
25
import org.eclipse.equinox.internal.p2.ui.viewers.MetadataRepositoryElementComparator;
23
import org.eclipse.equinox.internal.p2.ui.viewers.MetadataRepositoryElementComparator;
26
import org.eclipse.equinox.internal.p2.ui.viewers.RepositoryDetailsLabelProvider;
24
import org.eclipse.equinox.internal.p2.ui.viewers.RepositoryDetailsLabelProvider;
27
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
25
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
26
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
28
import org.eclipse.equinox.internal.provisional.p2.ui.*;
27
import org.eclipse.equinox.internal.provisional.p2.ui.*;
29
import org.eclipse.equinox.internal.provisional.p2.ui.model.MetadataRepositories;
28
import org.eclipse.equinox.internal.provisional.p2.ui.model.MetadataRepositories;
30
import org.eclipse.equinox.internal.provisional.p2.ui.operations.*;
29
import org.eclipse.equinox.internal.provisional.p2.ui.operations.*;
Lines 572-581 Link Here
572
			// nothing to report
571
			// nothing to report
573
		}
572
		}
574
		if (fail[0] != null) {
573
		if (fail[0] != null) {
575
			if (fail[0].getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND) {
574
			switch (fail[0].getStatus().getCode()) {
576
				ProvUI.reportNotFoundStatus(location, fail[0].getStatus(), StatusManager.SHOW);
575
				case ProvisionException.REPOSITORY_FAILED_READ :
577
			} else
576
				case ProvisionException.REPOSITORY_FAILED_AUTHENTICATION :
578
				ProvUI.handleException(fail[0], null, StatusManager.SHOW);
577
				case ProvisionException.REPOSITORY_INVALID_LOCATION :
578
				case ProvisionException.REPOSITORY_NOT_FOUND :
579
					ProvUI.reportNotFoundStatus(location, fail[0].getStatus(), StatusManager.SHOW);
580
					break;
581
				default :
582
					ProvUI.handleException(fail[0], null, StatusManager.SHOW);
583
			}
579
		}
584
		}
580
		repositoryViewer.update(selected[0], null);
585
		repositoryViewer.update(selected[0], null);
581
		setDetails();
586
		setDetails();

Return to bug 267887