You right, I forgot the ! before error
while(!error) is the right way, thank you ;)