|
@@ -282,16 +282,24 @@ public final class MarkerTool extends S3GuardTool {
|
|
|
}
|
|
|
FileSystem fs = path.getFileSystem(getConf());
|
|
|
boolean nonAuth = command.getOpt(OPT_NONAUTH);
|
|
|
- ScanResult result = execute(
|
|
|
- new ScanArgsBuilder()
|
|
|
- .withSourceFS(fs)
|
|
|
- .withPath(path)
|
|
|
- .withDoPurge(clean)
|
|
|
- .withMinMarkerCount(expectedMin)
|
|
|
- .withMaxMarkerCount(expectedMax)
|
|
|
- .withLimit(limit)
|
|
|
- .withNonAuth(nonAuth)
|
|
|
- .build());
|
|
|
+ ScanResult result;
|
|
|
+ try {
|
|
|
+ result = execute(
|
|
|
+ new ScanArgsBuilder()
|
|
|
+ .withSourceFS(fs)
|
|
|
+ .withPath(path)
|
|
|
+ .withDoPurge(clean)
|
|
|
+ .withMinMarkerCount(expectedMin)
|
|
|
+ .withMaxMarkerCount(expectedMax)
|
|
|
+ .withLimit(limit)
|
|
|
+ .withNonAuth(nonAuth)
|
|
|
+ .build());
|
|
|
+ } catch (UnknownStoreException ex) {
|
|
|
+ // bucket doesn't exist.
|
|
|
+ // replace the stack trace with an error code.
|
|
|
+ throw new ExitUtil.ExitException(EXIT_NOT_FOUND,
|
|
|
+ ex.toString(), ex);
|
|
|
+ }
|
|
|
if (verbose) {
|
|
|
dumpFileSystemStatistics(out);
|
|
|
}
|