Azure-sdk-for-java: [FEATURE REQ][Blob Storage] Rewrap UnknownHostException before throwing

Created on 18 Jun 2020  路  6Comments  路  Source: Azure/azure-sdk-for-java

Is your feature request related to a problem? Please describe.
When storage endpoints cannot be resolved by the blob storage SDK (v12), it throws an UnknownHostException wrapped in ReactiveException but that exception type is not public so it cannot be handled directly and will have to do a catch all.

Describe the solution you'd like
It would be nice if exceptions wrapped in ReactiveException are rewrapped with RuntimeException or something similar that is accessible and that the SDK generally uses for such runtime errors.

Describe alternatives you've considered
Do a catch all exceptions.

Additional context
NA

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Description Added
  • [x] Expected solution specified
Client Storage customer-reported question

All 6 comments

Hi, @SukruthKS. I think this is a fair request and would be good for us to update. We'll look into why ReactiveExceptions aren't getting wrapped in this case and work on fixing that. The only possible catch I can foresee is that sometimes our architecture board is not comfortable with changing exception types that get thrown as it might be thought of as a break, but I think we will be able to consider this a bug fix

There are also a couple places in our tests when we explicitly check for ReactiveExceptions, I believe mostly in query tests. We should be sure to update those exception types as well.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Hi, @SukruthKS. Quick question about this. You asked that ReactiveExceptions be unwrapped and re-wrapped as RuntimeExceptions. However, ReactiveException does extend RuntimeException, so I'm wondering what the difference will be if we re-wrap? Will you not be catching a RuntimeException either way?

Oh, I did not realize that it was extending RuntimeException. It should be good then. Thanks!

Sounds good! I am going to close this issue, then. Let us know if you need anything else.

Was this page helpful?
0 / 5 - 0 ratings