Unable to consistently fail build from an artifact transform

In my testing throwing a GradleScriptException only fails the build if an exception is thrown for every input artifact.

In the following example, Failing build is printed, but the build does not fail, and the exception is not logged.
If the throw is unconditional, the build fails and all exceptions for all input artifacts are logged.

public abstract class Foo implements TransformAction<Foo.Parameters> {
    public void transform(TransformOutputs outputs) {
        File inputArtifactFile = getInputArtifact().get().getAsFile();

        if (!inputArtifactFile.exists()) {
            System.out.println("Failing build");
            throw new GradleScriptException("", null);

How should I go about properly failing a build if something in my artifact transform fails?

After doing some more testing, I believe this only happens during ideaSyncTask and not during a normal gradle build.

Currently reporting on their issue tracker.