Include the list of 'excludes' glob patterns in the error message used when an IOException is encountered from a Globber. The io error may have been encountered during evaluation of one of the 'excludes' patterns.
RELNOTES: None
@@ -582,8 +582,11 @@ public final class PackageFactory {
Globber.Token globToken = context.globber.runAsync(includes, excludes, excludeDirs);
matches = context.globber.fetch(globToken);
} catch (IOException e) {
- String errorMessage =
- "error globbing [" + Joiner.on(", ").join(includes) + "]: " + e.getMessage();
+ String errorMessage = String.format(
+ "error globbing [%s]%s: %s",
+ Joiner.on(", ").join(includes),
+ excludes.isEmpty() ? "" : " - [" + Joiner.on(", ").join(excludes) + "]",
+ e.getMessage());
context.eventHandler.handle(Event.error(ast.getLocation(), errorMessage));
context.pkgBuilder.setIOExceptionAndMessage(e, errorMessage);
matches = ImmutableList.of();
