summaryrefslogtreecommitdiff
path: root/test/parallel/test-dgram-send-error.js
AgeCommit message (Collapse)Author
2019-06-17lib: correct error.errno to always be numericJoyee Cheung
Historically `error.errno` of system errors thrown by Node.js can sometimes be the same as `err.code`, which are string representations of the error numbers. This is useless and incorrect, and results in an information loss for users since then they will have to resort to something like `process.binding('uv'[`UV_${errno}`])` to get to the numeric error codes. This patch corrects this behavior by always setting `error.errno` to be negative numbers. For fabricated errors like `ENOTFOUND`, `error.errno` is now undefined since there is no numeric equivalent for them anyway. For c-ares errors, `error.errno` is now undefined because the numeric representations (negated) can be in conflict with libuv error codes - this is fine since numeric codes was not available for c-ares errors anyway. Users can use the public API `util.getSystemErrorName(errno)` to retrieve string codes for these numbers. PR-URL: https://github.com/nodejs/node/pull/28140 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-09src: move process.binding('uv') to internalBindingJames M Snell
PR-URL: https://github.com/nodejs/node/pull/22163 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-07-28dgram: hide underscored Socket propertiescjihrig
dgram sockets have a fair number of exposed private properties. This commit hides them all behind a single symbol property. PR-URL: https://github.com/nodejs/node/pull/21923 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-05-25test: cover dgram handle send failurescjihrig
This commit adds test coverage for the case where a dgram socket successfully binds, but the handle's send() function fails. PR-URL: https://github.com/nodejs/node/pull/13158 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-02-10test: add coverage for dgram send() errorscjihrig
This commit adds code coverage for emitted and callback errors for dgram's Socket#send() method. PR-URL: https://github.com/nodejs/node/pull/11248 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>