Getting job details or metadata for an invalid ID causes unhandled error
Closed this issue · 1 comments
jamesmorgan commented
Methods:
coconut.Metadata.retrieve()
coconut.Job.retrieve()
When using an unknown/invalid job ID causes the following error.
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (/node_modules/coconutjs/api.js:35:29)
at IncomingMessage.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I would expect the callback to be invoked with an error and not simply blowup.
"coconutjs": "^3.0.0"
At the moment the only way to stop this is to try/catch which feels wrong since the callback flow should be able handle this. Nothing seems to stop it 😢
brunoceleste commented
Hello,
It has been fixed with the latest release 3.0.3.
Thanks!