I've never seen a built in way to do this. You would need to work out exactly what causes the errors (if its always the same thing), then test for something that indicates they are about to happen e.g. all the field names you expect to exist in a particular table actually do.