How to get errors of 2D sketch, such as the over defined error of sketch block

I wrote a program to drive my sketch blocks using specific dimensions.

But I donnot know how to capture errors, such as "over defined" error, and so on.

How to get these errors of 2D sketch??

I cannot get any helpful API....

Can anybody help me? Thanks in advance!

SolidworksApi macros