brettlangdon / node-dogapi

Datadog API Node.JS Client
https://brettlangdon.github.io/node-dogapi/
105 stars 45 forks source link

Set Unknown Error as Default for Response Ending Rather than Null #84

Open cbeanLeadr opened 1 year ago

cbeanLeadr commented 1 year ago

Currently, it's possible for requests that end to send a null error on the error callback if data isn't written to the error as intended. This can cause consumers of the error callback to get tripped up if they're expecting an Error and receive null instead. To mitigate this, we should be returning an unknown Error instead as a fallback. Without this, null can cause system errors and crashes if not handled properly.

cbeanLeadr commented 2 months ago

Hi @brettlangdon, following up here to get some eyes on this 👍