Skip to content

Commit

Permalink
Fail fast when a dependency replacement handler throws an unhandled e…
Browse files Browse the repository at this point in the history
…xception. (#49)
  • Loading branch information
shartte authored Nov 19, 2023
1 parent c11afbd commit 3a63bef
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.neoforged.gradle.dsl.common.util.CommonRuntimeUtils;
import net.neoforged.gradle.dsl.common.util.ModuleReference;
import net.neoforged.gradle.util.TransformerUtils;
import org.gradle.api.GradleException;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
Expand Down Expand Up @@ -143,9 +144,11 @@ void handleDependency(final Configuration configuration, final ModuleDependency
break;
}
} catch (Exception exception) {
getProject().getLogger().info("Failed to process dependency replacement on handler: " + exception.getMessage(), exception);
throw new GradleException("Uncaught exception while processing replacement of dependency " + dependency.getGroup() + ":" + dependency.getName()
+ " using handler " + handler + ": " + exception.getMessage(), exception);
}
}

if (!dependencyReplacementInformation.contains(dependency, configuration)) {
dependencyReplacementInformation.put(dependency, configuration, candidate);
}
Expand Down

0 comments on commit 3a63bef

Please sign in to comment.