Deal with errors without going into a neverending loop.