-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[service-bus] Design discussion for error reporting #12286
[service-bus] Design discussion for error reporting #12286
Conversation
/// <summary> | ||
/// The user doesn't have access to the entity. | ||
/// </summary> | ||
Unauthorized, |
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.
This may be worthy of discussion. Feedback during Event Hubs was that we should use the natural exception in the language, if one applies. In this case, we were asked to use an UnauthorizedAccessException
. which is also the behavior from the EH and SB clients in Track One.
Since we're using language types like ArgumentException
, ArgumentOutOfRangeException
, InvalidOperationException
, and NotSupportedException
rather than wrapping them in ServiceBusException
, is there a reason that we don't want to do the same for the unauthorized scenario?
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.
Track 1 uses a custom UnathorizedException that derives from ServiceBusException.
I think the distinction of when we use ServiceBusException is when the exception actually comes from the service.
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.
Except for the other ones that I mentioned, which are in the AMQP mapping but go to standard language types. 😄
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.
Fair point - I assumed you were referring to the client side validation, but you are right - sometimes we wrap service errors in standard language exceptions.
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.
Personally, I don't feel strongly. Krzysztof did, at one point any may have guidance 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.
Yeah I think we should probably be consistent here for .NET.
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.
@KieranBrantnerMagee , I'm guessing that Python might have a similar concern but I don't know if there's a stdlib type exception that would cover this case (so you would have to make your own anyways).
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.
@JoshLove-msft - and for my own curiosity - are you saying you're going to swap over to using your native language exception here? I believe this change would only affect .net. @hemanttanwar - does Java have a similar built-in exception for this as well?
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.
Correct - there is no reason to differ from EH here, especially when we are already using native language exceptions for some service errors. If we were going to be consistent and always use SBException/EHException for service errors, it would be a different story.
|
||
## Additional questions | ||
|
||
- [ ] Are users expected to react to these errors? If so, what other flags/information might we need? |
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.
The attributes that I see as important are:
-
IsTransient
: Offers a hint to users if retrying may resolve the issue; also offers a hint to understand if the client has already retried according to its policy. -
Message
: What in the wide, wide world of sports is a-goin' on around here? (This is driven by the service response, when triggered as part of communication)
One that I've heard asked for and discussed that I think we should avoid:
WhoseFault
: An indication of "this was caused by something the user did" versus "this is just something that happened". While it is potentially helpful, the service does not give a clear indication of this and I do not believe the client should be attempting to interpret and classify the service response this way. If the service begins to return this, then yeah.... we should surface it.
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.
For the isTransient
, how would we know if it is a transient issue if we pass on the error as soon as it is encountered?
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.
If you do not retry, it's not transient. If you do.... 😄
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 do have the retryable flag for that! :)
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.
Retryable = IsTransient
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.
Don't you mean Retriable
? 😉
@chradek - any conflicts you see with what Event Hubs does? We're basically being additive with the reason code (and even then, this is only currently in service bus). But I'm guessing we'd want to potentially expose this there as well. |
@richardpark-msft I can't help but notice that many of the errors listed in the enum here match what we have in core-amqp, and as a user I'd probably be confused if I sometimes saw Other than that, looks reasonable to me! |
Yeah, it's definitely a reasonable concern. In the documentation the only spot they can really see a list of checkable codes will be on the We do demonstrate how to do error checking in our receiveMessagesStreaming sample so I think we'll be okay. |
Update:
|
Adding default values to fix correctness issue (Azure#12286) * Adding default values to fix correctness issue * revoke default value for allowedOrigins
The discussion on this has long since passed and we shipped the result of it. |
No description provided.