Check out example codes for "exception handling and reprompting". It will help you in understanding the concepts better.

Code Example 1

boolean flag = false;
while(!flag)
{
//make the loop break, if no exception caught
flag = true;
    try{

    }
    catch{
       //make the loop repeat
       flag = false;
    }
 }

Learn ReactJs, React Native from akashmittal.com