You can use Insure++ to assist you here:

http://www.parasoft.com/jsp/resource...rror_detection