Throw an error and exit with a non-zero status when a test fails