js-ipfsd-ctl icon indicating copy to clipboard operation
js-ipfsd-ctl copied to clipboard

Need to trap JSON.parse and emit more informative error on parse failure

Open SgtPooki opened this issue 2 years ago • 0 comments

https://github.com/ipfs/ipfs-desktop/issues/2004 and https://github.com/ipfs/ipfs-desktop/issues/2000 show that a JSON parse error happened, which points to https://github.com/ipfs/js-ipfsd-ctl/blob/70dff97afc5a194afc106b817b98575f8b122723/src/ipfsd-daemon.js#L366

we should wrap the json.parse in a try/catch and provide a more informative error message:

  1. What is the value of stdout
  2. What is the value of key

SgtPooki avatar Mar 03 '22 18:03 SgtPooki