0

I have the following code

class asdError extends Error {
  constructor(message) {
    super(message)
    this.name = 'asdError'
    
    Error.captureStackTrace(this, this.constructor)
  }
}

try {
  throw new asdError('asd')
} catch(error) {
  console.log(error.constructor.name)
}

If I run it by it self, like doing node ${filename}.js I get the expected constructor name: asdError. But when I run it in my web app I get Error as constructor.

My app was scaffolded using angular-fullstack generator and I run it using gulp serve.

If you need me to provide more information please tell me and I will do my best to provide it.

0 Answers0