Record error in test in preference to error in teardown.