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
Refactor FileTransfer.afterSuccess to afterTransfer #2094
Conversation
In order to prevent the deleting of files when MoveFileTransfer **fails**, it was necessary to provide the callback method with the number of errors. Further, to have the number of errors properly reported, it was necessary to notify of a FILE_EXCEPTION on any exception during uploadFile. Depending on other import settings, this could trigger a file upload, which in the case of in-place import is to be avaoided.
Assuming
gives me this now:
|
Perhaps it's worth adding this to a testing scenario. |
} else { | ||
String msg = "Unexpected exception thrown!"; | ||
log.error(msg, e); | ||
throw new RuntimeException(msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do throw new RuntimeException(msg, e);
so as not to swallow the cause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, thanks.
Here's the set up for testing that failed delete works:
What I see with commit 789a55b is:
|
@@ -407,17 +407,25 @@ public String uploadFile(final ImportProcessPrx proc, | |||
file, index, srcFiles.length, | |||
proc, this, estimator, cp, buf)); | |||
} | |||
catch (IOException e) { | |||
catch (Exception e) { | |||
// Required to bump the error count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fixes pushed.
Works well:
|
Good to merge. |
Refactor FileTransfer.afterSuccess to afterTransfer
--rebased-to #2125 |
In order to prevent the deleting of files when MoveFileTransfer
fails, it was necessary to provide the callback method with
the number of errors.
Further, to have the number of errors properly reported, it was
necessary to notify of a FILE_EXCEPTION on any exception during
uploadFile.
Depending on other import settings, this could trigger a file
upload, which in the case of in-place import is to be avaoided.
/cc @mtbc @pwalczysko