Started working with try and catch errors, but got stuck when trying to put a throw in a do-while-loop