Logging: Added logging of getNextError

o To see the full cause of possible exceptions