gradle-tooling-API : Capture Compilation Issue

We are working on an online editor for the java code.

I am using Gradle Tooling API to build my final jar for the java project I am trying to build.

When there is any compilation issue in my java code, the gradle gives me a build exception.
I am able to extract the compilation output only as a build.setStandardError(outputStream);
But this content in the outputStream is pure text and then we have to analyze and extract information like which file and which line etc…
Is there any structured output available in any class?