From instanceof to Error.isError: safer error checking in JavaScript
allthingssmitty.com