Sonar fixes
- a few complexities - final method calls from ctor - raw exception throwing - useless overrides - loss of stack trace
This commit is contained in:
committed by
Artem Bilan
parent
7569d0ad79
commit
36c33bb5ab
@@ -208,14 +208,19 @@ public class SftpSession implements Session<LsEntry> {
|
||||
}
|
||||
}
|
||||
catch (IOException ioex) {
|
||||
throw new NestedIOException("Failed to delete file " + pathTo, ioex);
|
||||
NestedIOException exception = new NestedIOException("Failed to delete file " + pathTo, sftpex);
|
||||
exception.addSuppressed(ioex);
|
||||
throw exception; // NOSONAR - added to suppressed exceptions
|
||||
}
|
||||
try {
|
||||
// attempt to rename again
|
||||
this.channel.rename(pathFrom, pathTo);
|
||||
}
|
||||
catch (SftpException sftpex2) {
|
||||
throw new NestedIOException("failed to rename from " + pathFrom + " to " + pathTo, sftpex2);
|
||||
NestedIOException exception =
|
||||
new NestedIOException("failed to rename from " + pathFrom + " to " + pathTo, sftpex);
|
||||
exception.addSuppressed(sftpex2);
|
||||
throw exception; // NOSONAR - added to suppressed exceptions
|
||||
}
|
||||
}
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user