node.jspm2sendwithus

pm2 causing error inside sendwithus module


Our transfer service has been having issues, somehow when I run the transfer service off my the regular node command it works, but when I run it with pm2 is will cause an error INSIDE the sendwithus module. It does not hit my error catching at all.

This becomes an issue because it gets stuck in PROCESSING and takes up a concurrency slot.

Our robot friends can't seem to help on this one, it keeps trying to change the error handling to catch these errors, but these errors shouldn't be there at all.

Here is the error that is coming out on the error output on pm2

TypeError: Cannot read properties of undefined (reading 'ok')
    at Sendwithus._handleResponse (/home/mike/changed-javascript/backend/services/node_modules/sendwithus/lib/sendwithus.js:122:23)
    at /home/mike/changed-javascript/backend/services/node_modules/sendwithus/lib/sendwithus.js:91:63
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

So the only move I can really think of, is to totally drop the sendwithus module for these services and do the raw API with fetch. What can I look into next?


Solution

  • I ended up solving this by getting off the sendwithus module and hitting the raw endpoint instead.