Improve build test error handling