From c0a5b3fcc4a2d7f5c30f95e9b387c8a2e02b4f6f Mon Sep 17 00:00:00 2001 From: Mathieu Féry Date: Thu, 15 Jun 2023 18:31:34 +0200 Subject: feat(translationUnit): Improve logs in case of failure inside translationUnit --- src/java/com/jogamp/gluegen/GlueGen.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/java/com/jogamp/gluegen') diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java index 6dee6f0..b445afa 100644 --- a/src/java/com/jogamp/gluegen/GlueGen.java +++ b/src/java/com/jogamp/gluegen/GlueGen.java @@ -167,7 +167,15 @@ public class GlueGen implements GlueEmitterControls { try { parser.translationUnit(); } catch (final RecognitionException e) { - throw new RuntimeException("Fatal IO error", e); + throw new RuntimeException(String.format( + "Fatal error during translation (Localisation : %s:%s:%s)", + e.getFilename(), e.getLine(), e.getColumn() + ), e); + } catch (final TokenStreamRecognitionException e) { + throw new RuntimeException(String.format( + "Fatal error during translation (Localisation : %s:%s:%s)", + e.recog.getFilename(), e.recog.getLine(), e.recog.getColumn() + ), e); } catch (final TokenStreamException e) { throw new RuntimeException("Fatal IO error", e); } -- cgit v1.2.3