This function seems a little weird to me, since it has a side effect of modifying `_hasErrors` and the order of operations is confusing. I actually wonder if it would be clearer if it weren't factored out from `_handleLiveDocumentError` and were just integrated with the code there. (It doesn't seem to be called from anywhere else, so there isn't really any value in keeping it in a separate function.)