is

fun is(exceptionTag: Tag): Boolean(source)

The is() prototype method of the Exception object can be used to test if the Exception matches a given tag.

MDN Reference