Closed lmahoney1 closed 1 year ago
@lmahoney1 this is a fantastic idea. I will begin investigation on this in the coming release timeframe and let you know whether or not we think this is possible. On first glance, I can't see why we wouldn't do this.
Hi @lmahoney1 — we've figured out the root issue here and the solution is actually to include resilient.co3base.BasicHTTPException
as the parent class for the new RetryHTTPException
. This is because all resilient clients are SimpleClient
s and the SimpleClient
is where the SimpleHTTPException
is raised. This change to the base class of RetryHTTPException
will fix that up and exceptions will begin to be raised as SimpleHTTPExceptions
again.
We plan to make this change as soon as we can and get it tested and released. It will not make the version 50 release which will come before the end of the month. But it will be available soon after that and I'll let you know how that goes.
Hi @lmahoney1 — we've developed a fix for this and it will be targeted for a 50.1.x version release later this month or early next. I'm going to close out this issue now given that the fix is already in QA. Thanks!
@lmahoney1 released today to PyPi! v50.1.262
Great news. Thanks for the work on this Bo, much appreciated!
Previously when using the
self.rest_client()
object within an IBM SOAR function it would raise aSimpleHTTPException
exception when it encountered a web request error. Must have been a recent change but I'm seeing that certain response codes are getting re-tried and if all retries fail aRetryHTTPException
is raised.I think this is great, however all of my IBM SOAR functions I have created are setup to catch
SimpleHTTPException
s and notRetryHTTPException
.If
RetryHTTPException
inherited fromSimpleHTTPException
it would still get caught byNot 100% positive that
SimpleHTTPException
would be the best 'root' / generic web request to inherit from, but it would work best for me.I can change my except blocks to be
but I would rather not have to change that in all of our functions. I think it makes logical sense for
RetryHTTPException
to inherit from a 'generic' http exception, just not 100% positive ifSimpleHTTPException
fits that bill or not.Additionally, importing these two exceptions is different:
Noticed that
SimpleHTTPException
is imported in/resilient/__init__.py
but RetryHTTPException isn't. I think a consistent import would be nice - so something likefrom resilient import SimpleHTTPException, RetryHTTPException
would workRetryHTTPException
definition: https://github.com/ibmresilient/resilient-python-api/blob/84e8c6d9140ceac0bf47ce0b98e11c7953d95e61/resilient/resilient/co3base.py#L72