You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
@WhiteRabbit68 while I don't disagree, it could go the other way - why don't you avoid unnecessary method invocation if there are no messages to complete? Worse if it's on the hot path.
Or would you prefer to see an exception with a different message that is more meaningful?
Sure, but avoiding unnecessary calls should be the responsibility of the client:
if (tokensToComplete.Any())
await receiver.CompleteAsync(tokensToComplete);
It seems strange that an API should throw exceptions just because it thinks it was called in vain, but I would rather have ArgumentException("Value cannot be empty list") that forces the check above if so.
In any case, erroneous error messages are very frustrating, just spent some time wondering how the list of tokens could be null.
Actual Behavior
This is misleading because the parameter is NOT null. Why is it an error to supply an empty list? Just return without doing anything.
Expected Behavior
Versions
The text was updated successfully, but these errors were encountered: