Skip to content
Snippets Groups Projects
Commit 3ab8d9e2 authored by brinn's avatar brinn
Browse files

minor: improve logging when assertion fails

SVN: 1879
parent ca25e989
No related branches found
No related tags found
No related merge requests found
...@@ -117,9 +117,9 @@ public class RsyncCopier implements IPathCopier ...@@ -117,9 +117,9 @@ public class RsyncCopier implements IPathCopier
public Status copy(File sourcePath, String sourceHost, File destinationDirectory, String destinationHost) public Status copy(File sourcePath, String sourceHost, File destinationDirectory, String destinationHost)
{ {
assert sourcePath != null; assert sourcePath != null;
assert sourceHost != null || sourcePath.exists(); assert sourceHost != null || sourcePath.exists() : logNonExistent(sourcePath);
assert destinationDirectory != null; assert destinationDirectory != null;
assert destinationHost != null || destinationDirectory.isDirectory(); assert destinationHost != null || destinationDirectory.isDirectory() : logNonExistent(sourcePath);
assert sourceHost == null || destinationHost == null; // only one side can be remote assert sourceHost == null || destinationHost == null; // only one side can be remote
final File destinationPath = new File(destinationDirectory, sourcePath.getName()); final File destinationPath = new File(destinationDirectory, sourcePath.getName());
...@@ -163,6 +163,17 @@ public class RsyncCopier implements IPathCopier ...@@ -163,6 +163,17 @@ public class RsyncCopier implements IPathCopier
} }
} }
private String logNonExistent(File path)
{
if (path == null)
{
return "null";
} else
{
return "path '" + path.getAbsolutePath() + "' does not exist";
}
}
private List<String> createCommandLine(File sourcePath, String sourceHost, File destinationDirectory, private List<String> createCommandLine(File sourcePath, String sourceHost, File destinationDirectory,
String destinationHost) String destinationHost)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment