Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!