@nojaf, well the issue comes from the fact there’s no silver bullets when it comes to know if a given variable is a JS error! So you can either be defensive with it and use any kind of knowledge about what you expect to catch to test if it indeed has the shape you’d like, or just trust the system and state that it’s indeed a JS error as you did!
Unfortunately there’s no easy answer, testing if the variable is of instance Error doesn’t always work for example.