- public SchemaResolutionException(final @Nonnull String message, final Throwable cause, @Nonnull final Map<SourceIdentifier, ? extends Throwable> unresolvedSources) {
- super(message, cause);
- this.unresolvedSources = ImmutableMap.copyOf(unresolvedSources);
+ public SchemaResolutionException(@Nonnull final String message, final Throwable cause,
+ @Nonnull final Collection<SourceIdentifier> resolvedSources,
+ @Nonnull final Multimap<SourceIdentifier, ModuleImport> unsatisfiedImports) {
+ super(formatMessage(message, resolvedSources, unsatisfiedImports), cause);
+ this.unsatisfiedImports = ImmutableMultimap.copyOf(unsatisfiedImports);
+ this.resolvedSources = ImmutableList.copyOf(resolvedSources);
+ }
+
+ private static String formatMessage(final String message, final Collection<SourceIdentifier> resolvedSources, final Multimap<SourceIdentifier, ModuleImport> unsatisfiedImports) {
+ return String.format(MESSAGE_BLUEPRINT, message, resolvedSources, unsatisfiedImports);