Uh oh!
There was an error while loading. Please reload this page.
stream: use synchronous error validation & validate abort signal option - #41777
Conversation
nodejs-github-bot
commented
Jan 30, 2022
Review requested:
|
49b4925 to
347b307CompareUh oh!
There was an error while loading. Please reload this page.
benjamingr
left a comment
There was a problem hiding this comment.
Left some comment about the difference between errors in generators/async functions in this API other than that looks good thanks 🙏
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option
347b307 to
2e4f992Comparenodejs-github-bot
commented
Jan 31, 2022
nodejs-github-bot
commented
Jan 31, 2022
| if (options?.signal != null) { | ||
| validateAbortSignal(options.signal, 'options.signal'); | ||
| } |
There was a problem hiding this comment.
This can be simplified to validateAbortSignal(options?.signal, 'options.signal') (also in other places)
| assert.rejects(() => Readable.from([]).reduce((x, y) => x + y, 0, 1), /ERR_INVALID_ARG_TYPE/); | ||
| assert.rejects(() => Readable.from([]).reduce((x, y) => x + y, 0, { signal: true }), /ERR_INVALID_ARG_TYPE/); |
There was a problem hiding this comment.
these two should probably have .then(common.mustCall()) (e.g. like you did in test-stream-some-every)
There was a problem hiding this comment.
You can also add it to the two lines above them (that you didn't add).
nodejs-github-bot
commented
Feb 3, 2022
Landed in 06625ff |
iMoses
commented
Feb 3, 2022
@Linkgoron would you like me to take care of your notes in a future PR? |
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: #41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: #41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: #41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: nodejs/node#41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
made sure top level methods aren't async/generators
so that validation errors could be caught synchronously
also added validation for the abort signal option