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

135
Views
Try Catch methods are throwing promises
let metadata = allNFTs.map(async (e) => {
      try {
        const res = JSON.parse(e.metadata.attributes);
        return res;
      } catch (err) {
        // throw err;
        let config = {
          method: "get",
          url: `http://localhost:3000/api/fetch`,
          header: {
            "Content-Type": "application/json",
          },
        };
        const res = await axios(config);
        console.log(res.data.attributes);
        return res.data.attributes;
      }
    });
console.log(metadata);

I want use try catch method like this but all i can get bunch of promises on my console

enter image description here

When i tried if statement my next.js app throwing me that error. I want to do something if e.metadata.attributes is empty or null or undefined but my app throwing errors.

about 4 years ago · Santiago Trujillo
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!