genbat error handling for gram, pc