libclang-python: recovering from parsing error

I was hoping to use libclang to parse files to write a generator. As a test, I was using libui (https://github.com/andlabs/libui/), however, as I ran index.parse, all I get is a clang.cindex.TranslationUnitLoadError, which I can catch, but I cannot seem to find a way to deal with figuring out why it fails. I noticed in cindex.py:

o API support for invalid translation units. Currently we can’t even get the

diagnostics on failure because they refer to locations in an object that

will have been invalidated.

So it appears I cannot get the diagnostic info? If not, would I be able to get diagnostics if I use the underlying clang_parseTranslationUnit in C? I don’t mind wrapping some C code if needed.

Thanks for any guidance you can provide!