util: improve internal `isError()` validation #24746
The current internal isError function checked the toString value
sam-github left a comment
I think this should have some unit tests, specifically, some that failed before the change and succeed afterwards. My js isn't good enough, I don't understand the subtleties of how it is becoming more precise, and was hoping to learn what corner cases are better covered from the tests.