Well yes you can parse the data form there. It will just slow your maya to a crawl because you will need to parse all output, You idnt catch the warning just the string buffer, not exactly the same thing. Also the buffer is not guaranteed to be timely so it may be off in sequence.
The warning is about yoru settings beimg wrong is you should fix that instead. Its a broken paradigm thats all, its based on fixing once something is broken, design should be something thst never borken istead. Sop even if you can you should not.
PS: theres a way to dicover that the rigid body is in a bad state, much easier, but is not any better for a solutional point of view. So i wont tell because its only going to make your problems worse. So no I dont vant to participate in you shooting your leg, much less in avoiding you shooting in the leg just to ensure you shoot your own head.