Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore the UnsupportedOperationException in case of descriptor removal #472

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class Messages extends NLS {
public static String MirrorLog_Exception_Occurred;

public static String MirrorRequest_multipleDownloadProblems;

public static String MirrorRequest_removal_failed;
public static String MirrorRequest_transferFailed;

public static String exception_unableToCreateParentDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,20 @@ else if (ProcessingStepHandler.canProcess(descriptor2))
if (target.contains(destinationDescriptor)) {
try {
target.removeDescriptor(destinationDescriptor, subMonitor.split(1));
} catch (UnsupportedOperationException e) {
setResult(Status.warning("unable to remove Descriptor", e)); //$NON-NLS-1$
return;
} catch (RuntimeException e) {
// In case the repository does not support this, fall through to get the real
// error, maybe the repository does not support downloads at all!
Status warning = Status.warning(NLS.bind(Messages.MirrorRequest_removal_failed, destinationDescriptor),
e);
if (status instanceof MultiStatus multi) {
multi.add(warning);
} else {
MultiStatus multiStatus = new MultiStatus(Activator.ID, 0,
NLS.bind(Messages.MirrorRequest_transferFailed, descriptor), null);
multiStatus.add(status);
multiStatus.add(warning);
status = multiStatus;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exception_noComparators = No Artifact Comparators are available.
MirrorLog_Console_Log=Logging to the console instead.
MirrorLog_Exception_Occurred=An exception occurred while writing to the log:
MirrorRequest_multipleDownloadProblems=Multiple problems occurred while downloading.
MirrorRequest_removal_failed=Target repository contains descriptor after failed download but it can't be removed: {0}
MirrorRequest_transferFailed=Failed to transfer artifact {0}.

exception_unsupportedAddToComposite = Cannot add descriptors to a composite repository.
Expand Down
Loading