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

256
Vistas
If it possible in typescript to clone error with some modifications?

I stucked with an issue - I'm trying to use Sentry.captureException with received error, but before that i'm trying to change error message. Spent a lot of time to find an answer to my question, but i had no success. How could i create a new error with type Error | AxiosError and clone into that variable all the properties and change message? I can't use custom errors, because i don't want to change a lot of code.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

  await axios.get("xxx").then(result => {
    // Success
  }).catch((err: AxiosError) => {
    Sentry.captureException({
      ...err,
      response: {
        ...err.response,
        data: "Custom error message"
      }
    });
  });

Does this approach solve the problem?

about 4 years ago · Juan Pablo Isaza Denunciar
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