================
@@ -3598,9 +3598,13 @@ def reparse(self, unsaved_files=None, options=0):
             unsaved_files = []
 
         unsaved_files_array = self.process_unsaved_files(unsaved_files)
-        ptr = conf.lib.clang_reparseTranslationUnit(
-            self, len(unsaved_files), unsaved_files_array, options
+        result = int(
+            conf.lib.clang_reparseTranslationUnit(
+                self, len(unsaved_files), unsaved_files_array, options
+            )
         )
+        if result != 0:
+            raise TranslationUnitLoadError("Error reparsing translation unit.")
----------------
DeinAlptraum wrote:

I think it would be preferable to include the error code in the message.
FWIW the C-side documentation also mentions the error code documentation
https://clang.llvm.org/doxygen/group__CINDEX__TRANSLATION__UNIT.html#ga524e76bf2a809d037934d4be51ea448a

https://github.com/llvm/llvm-project/pull/172373
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to