-
Notifications
You must be signed in to change notification settings - Fork 605
Open
Description
Which node are you reporting and issue on?
node-red-node-cbor
What are the steps to reproduce?
send a timestamp as integer to decode - the decoder exits with the error message "Bad Decode"
What happens?
the node-red-node-cbor plugin serializes the decoded result with JSON:
node-red-nodes/parsers/cbor/70-cbor.js
Line 19 in 06a9c48
| node.status({text:l +" b->o "+ JSON.stringify(value).length}); |
As JSON does not support BigInt, this creates an error message when you are decoding a timestamp for example.
What did you expect to happen?
- The decoder should decode correctly sent buffers without error message.
- The error message should correspond to the actual error.
Proposed solution
- I propose to add a replacer function and convert BigInt and other unsupported formats.
- The error message "not a cbor buffer" is not always correct. I would prefer to use the actual error message.
Additionally, cbor-x library is out of date and should be updated.
Metadata
Metadata
Assignees
Labels
No labels