or better yet an example in java:

while(!learned)
{
try
{
research("looping");
}catch(IGaveUpException e)
{
increaseEffort();
}
}