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

152
Vistas
How to show value from response body when test fails

I'm new to writing pre-request script and tests in Postman. So, I wonder if there's possible to make show the value from response body when the tests fail.

This is the example of the error response body and I want the test result to "FAIL" and show the value from "errorReason" in the test results tab.

{
    "errors": [
        {
            "errorCode": 401,
            "errorReason": "BALANCE_BELOW_ZERO"
        }
    ]
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I using this way to get error message from api

async getSomething() {
    try {
      let response = await axios.get(
        `API/getSomething`
      );
      let data = response.data;
      htmlElememt.innerHTML = data 
      
    } catch (e) {
     // according to your error response 
      alert(e.response.errors.errorReason);
    }
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