-
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] ServiceBusErrorCode missing InvalidOperation and Argument related errors #12559
Comments
Initial thoughts:
I think
I'm not sure what an example of this would be for Service Bus, but this also seems like the sort of error you'd see while developing an application due to a misconfiguration or possibly using a method incorrectly, and not something you'd write defensive code against. With that in mind I think
@bterlson @xirzec I'd like your opinions on if we should convert server-side validation errors into native JS errors (TypeError/RangeError). I have typically thought of those as reserved for client-side validation errors but I'd like other opinions on this subject |
I agree with your recommendation of using GeneralError for the
Well, the reaction to this error condition would be to change the code and not create a new connection or process because it would not change the set of user defined things that resulted in the frame being inconsistent with the semantics. One example is trying to send a message without sessionId to a session enabled queue. |
Sorry, I didn't word my point well. What I meant was that I didn't think a customer would realistically write defensive code for a |
That I agree with. For errors that fall under the |
I wouldn't use these errors for anything involving service interactions, but I admit I don't have a good grasp on when these errors are thrown in practice. I like the direction of this thread re: |
Yup, I also like the idea of prefixing the error message with the With regards to the argument-error and argument-out-of-range error, we got confirmation that we shouldn't be able to trigger these from the service unless there was something wrong with the SDK itself. With that in mind, I think we treat these the same as the other 2 types and just prefix the error message with the messaging error code. |
…iceBusError GeneralError messages (#12585) Fixes #12559 and #12573 This change updates `ServiceBusError` in 2 ways. 1. Adds a constructor that accepts `message` and `code` directly. This lets us throw `ServiceBusError`s from the client without having to first create a `MessagingError`. 2. Update the constructor so that if a MessagingError's code is translated to `GeneralError`, the MessagingError's code is prefixed in the ServiceBusError message. This should provide additional context to the user on what went wrong.
We added
ServiceBusErrorCode
to loosely mirror the ServiceBusFailureReason in the .Net SDKApart from the failure reason for the
ServiceBusException
, the .Net SDK provides its users other built in exception classes so that they can differentiate the different AMQP error conditions. In the absence of such different classes in the JS SDK, all such scenarios get lumped intoGeneralError
. This issue is to either consider adding error codes for such error scenarios or to consider using the built in classes in JS likeRangeError
andTypeError
.The text was updated successfully, but these errors were encountered: