digitalnodecom / node-red-contrib-generic-s3

Generic S3 nodes for use in Node-RED
https://www.npmjs.com/package/@digitalnodecom/node-red-contrib-generic-s3
Apache License 2.0
3 stars 5 forks source link

Cloning objects that cannot be cloned throws exception #64

Closed trajche closed 10 months ago

trajche commented 10 months ago

Since the latest update you use structuredClone and async processing. When cloning an object that contains a function it throws an exception that crashes node-red:

DataCloneError: function onReadableStreamEnd() {
  if (!this.allowHalfOpen) {
    this.write = writeAfterFIN;
  }
} could not be cloned.

If possible, can we have an error message rather than a crash stating an object cannot be cloned?

Maybe a check such as this?

rristov60 commented 10 months ago

Hi @trajche, thanks for opening this issue. This is being worked on and will be fixed fairly soon. It is planned for the node to throw an error which can be caught with catch node.

rristov60 commented 10 months ago

@trajche this has been patched in the latest release v1.12.2