die correctly if test-packages fails
handle last error case