Errors in rebuild?

Does anybody know how to tell if the current document has any errors using the API? I have looked and looked and cannot find anything.

SolidworksApi macros