typescript-generator icon indicating copy to clipboard operation
typescript-generator copied to clipboard

Build should fail if a class cannot be found

Open yankee42 opened this issue 5 years ago • 1 comments

I am using typescript generator as part of my build process using a maven plugin.

When a class cannot be found (e.g. because of a typo in the type name in pom.xml) then an error is printed, but the build continues. However this will naturally result in an incomplete output file which will cause some confusion when that incomplete file is used elsewhere.

It would make it easier to detect such an error early on by failing the build process and thus alerting the user.

The ClassNotFoundException is currently caught, printed and then ignored here: https://github.com/vojtechhabarta/typescript-generator/blob/63ee545173a1bb62ace5155a46523287226d75e7/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/Input.java#L176

yankee42 avatar Mar 07 '19 12:03 yankee42

@yankee42 you are right, this is not optimal. This behavior (continuing after error) was added as part of solving class loading problem (#142). I will consider to changing it, maybe it is not needed anymore.

vojtechhabarta avatar Mar 13 '19 20:03 vojtechhabarta

Released in v3.0.1157.

vojtechhabarta avatar Oct 02 '22 16:10 vojtechhabarta