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

144
Views
Parsing nested JSON from aws SNS message

I'm having trouble returning errorMessage from this nested JSON response I get from an aws SNS message. Part of the problem, I think, is the weird spaces and formatting this is returned in. I parsed the whole thing once to get message which I'm able to return values like executionIdfrom, but JSON.parse(message.errorData) already throws me an error before I can continue downward to -> Cause -> errorMessage.

{"executionId":"<<ARN REDACTED>>","stateName":"9b44bafc-d542-4533-8091-5c9a2bfd9983","startTime":"2022-04-07T16:20:59.350Z","sourceStepFunction":"<<REDACTED>>","errorData":{"Error":"Error","Cause":"{\"errorType\":\"Error\",\"errorMessage\":\"Request failed with status code 400\",\"trace\":[\"Error: Request failed with status code 400\",\"    at e.exports (/var/task/index.js:2:69443)\",\"    at e.exports (/var/task/index.js:2:71859)\",\"    at IncomingMessage.<anonymous> (/var/task/index.js:2:62409)\",\"    at IncomingMessage.emit (events.js:412:35)\",\"    at IncomingMessage.emit (domain.js:475:12)\",\"    at endReadableNT (internal/streams/readable.js:1334:12)\",\"    at processTicksAndRejections (internal/process/task_queues.js:82:21)\"]}"}}
about 4 years ago · Santiago Gelvez
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!