From 09157ab8973ef8497f8b6dad001a94c854ebda17 Mon Sep 17 00:00:00 2001 From: MooseFriend Date: Sun, 26 Oct 2025 18:58:55 +0100 Subject: [PATCH] Save original error message (without context info) in exception Added a new attribute to save the original error message. --- compiler/ksp_compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/ksp_compiler.py b/compiler/ksp_compiler.py index 1116085..f4f99de 100644 --- a/compiler/ksp_compiler.py +++ b/compiler/ksp_compiler.py @@ -224,6 +224,8 @@ def __init__(self, line, message): Exception.__init__(self, msg) self.line = line self.message = msg + # Save the original error message (without any context info) + self.error_message = message class Line: '''Line object used for handling lines before AST lex/yacc parsing''' @@ -2730,4 +2732,4 @@ def __repr__(self): utils.log_message("The output file for the compiled code was not defined, however compilation ended successfully in %s!" % delta) if __name__ == "__main__": - main() \ No newline at end of file + main()