Azure-sdk-for-net: Make ServiceBusException.FailureReason no longer a nested public type

Created on 7 Jul 2020  路  5Comments  路  Source: Azure/azure-sdk-for-net

Instead, make it into something like ServiceBusFailureReason. No need to have it nested in ServiceBusException.

Client Service Bus

Most helpful comment

Yes, I probably did. This feels a lot like the {Service}ErrorCode pattern we have for all the other libraries and I didn't understand why it's different here. Let's chat about it for 2 minutes at tomorrow's team meeting?

All 5 comments

For context, the decision was made to nest it in the Event Hubs design because the type is not intended to stand on its own; it has meaning only within the context of that specific exception type. I don't recall there being a strong opinion during architect review, but we may want to be sure that there is buy-in and also consider whether it makes sense to keep the same pattern between the messaging services.

Ah yes, we have the same meaning here, but if I recall during the API Review, @tg-msft questioned nesting it.
But if EH is already doing it this way, perhaps it is not worth diverging.

Yes, I probably did. This feels a lot like the {Service}ErrorCode pattern we have for all the other libraries and I didn't understand why it's different here. Let's chat about it for 2 minutes at tomorrow's team meeting?

As per discussion offline, it seemed like we leaned toward doing this, despite it being against what EH has. The rationale was it is more consistent with a similar pattern in the rest of the SDKs.

/cc @KrzysztofCwalina any objections to lifting this out of ServiceBusException so that it is no longer nested?

Was this page helpful?
0 / 5 - 0 ratings