tiagordc / node-red-contrib-simple-soap

node-red node to execute SOAP requests and parse XML result
MIT License
2 stars 4 forks source link

Fail gracefully for invalid payload (ERR_INVALID_ARG_TYPE) #7

Closed beevelop closed 1 year ago

beevelop commented 4 years ago

When accidentally setting the payload to an object, the module fails and kills the Node-RED instance. It would be awesome to handle this error gracefully and e.g. log via node.error / use the status with an error hint.

25 Jun 13:21:52 - TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string or Buffer. Received type object
at write_ (_http_outgoing.js:595:11)
at ClientRequest.write (_http_outgoing.js:567:10)
at Request.write (/data/node_modules/node-red-contrib-simple-soap/node_modules/request/request.js:1500:27)
at end (/data/node_modules/node-red-contrib-simple-soap/node_modules/request/request.js:549:18)
at Immediate.<anonymous> (/data/node_modules/node-red-contrib-simple-soap/node_modules/request/request.js:578:7)
nero408 commented 4 years ago

from Imgflip Meme Generator

bastian1993 commented 4 years ago

I can confirm that, would be great to get better handling.