trap errors right before start of testing