Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
Global exception handler using globalThis in VSCode

So I tested this on the sandbox and this works:

globalThis.onunhandledrejection = event => {
    console.log(event.promise);   
    console.log("TEST")// get the promise
    console.log(event.reason);      // get the rejection reason
};
    const myPromise = new Promise((resolve, reject) => {
      reject('Ouch');
  });
  myPromise.then(() => {
      console.log('Hello world');
  });

However if I put it inside my vscode extension code it does not handle rejections, neither does the "test" appear on the console. It doesn't break the extension too. Any ideas how to make it work?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda