I'm using an npm module that throws an empty function i.e. UnauthorizedException upon error. I want to be able to identify the function thrown so i can handle it accordingly
function UnauthorizedException() {
}
const f = () => {
  throw (new UnauthorizedException());
};
try {
  f();
} catch (err) {
  // How to identity a function name/property/etc so I can handle the error accordingly
  console.log(err);
  console.log(typeof (err));
}
 
    