Skip to content

Commit

Permalink
No option to continue transfer for network failures. Fix #8182.
Browse files Browse the repository at this point in the history
Former-commit-id: 8664a0b2406ce82f38186561bc60ad801b12608f
  • Loading branch information
dkocher committed Aug 18, 2014
1 parent 8278079 commit ea49689
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions source/ch/cyberduck/ui/action/AbstractTransferWorker.java
Expand Up @@ -28,6 +28,8 @@
import ch.cyberduck.core.SleepPreventerFactory;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.exception.ConnectionCanceledException;
import ch.cyberduck.core.threading.DefaultFailureDiagnostics;
import ch.cyberduck.core.threading.FailureDiagnostics;
import ch.cyberduck.core.transfer.Transfer;
import ch.cyberduck.core.transfer.TransferAction;
import ch.cyberduck.core.transfer.TransferErrorCallback;
Expand Down Expand Up @@ -84,6 +86,9 @@ public abstract class AbstractTransferWorker extends Worker<Boolean> {
private Cache<TransferItem> cache
= new Cache<TransferItem>(Integer.MAX_VALUE);

private FailureDiagnostics<BackgroundException> diagnostics
= new DefaultFailureDiagnostics();

public AbstractTransferWorker(final Transfer transfer, final TransferOptions options,
final TransferPrompt prompt, final TransferErrorCallback error) {
this.transfer = transfer;
Expand Down Expand Up @@ -242,6 +247,9 @@ public TransferStatus call() throws BackgroundException {
throw e;
}
catch(BackgroundException e) {
if(diagnostics.determine(e) == FailureDiagnostics.Type.network) {
throw e;
}
// Prompt to continue or abort
if(error.prompt(e)) {
// Continue
Expand Down Expand Up @@ -300,6 +308,9 @@ public TransferStatus call() throws BackgroundException {
}
catch(BackgroundException e) {
status.setFailure();
if(diagnostics.determine(e) == FailureDiagnostics.Type.network) {
throw e;
}
// Prompt to continue or abort
if(error.prompt(e)) {
// Continue
Expand Down

0 comments on commit ea49689

Please sign in to comment.