Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Event Hubs] Use AwaitableSender in lieu of Sender #4446
[Event Hubs] Use AwaitableSender in lieu of Sender #4446
Changes from 15 commits
260b0e6
c74f5e4
00016cb
5c12c13
2081256
f3511e0
7f00436
e2dc78b
232390c
05046df
c58e6eb
298990b
5956ffa
b2633be
264794c
aa664ff
25e3f63
edf1949
ebd7dde
11dbe10
cb14ba3
f5f0428
abc9689
ffca3c9
dee862c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to cover any of the amqp errors here because amqp errors should undergo the appropriate processing as covered in the
translate()
. Therefore, make an early exit from here ifisAmqpError(err)
returnstrue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that we have updated the if/else in translate() to use the result of this method only when it is not an amqp error. That is good.
But here since the input supports both AmqpError and simple Error, it is still confusing to anyone reading this code independently
My first suggestion would have been to update this method to take in only
Error
, but this might not work out due to typing issues. Because as far as the typescript compiler is concerned, theerr
object you pass in could be either of the 2 types.Please consider not having this as a separate method and moving the code here directly into
translate()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to add a return here or else the function will continue running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rejectOnAbort
has areturn reject(..)
in it, would we still need anotherreturn
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
rejectOnAbort
is a function. Thereturn
in it only returns from that function and not the outer code set of {}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated..