Move try-catch for --ignore-errors to a more effective part.