UnboundLocalError when SansIOHTTPPolicy handles an exception #15222
Labels
Azure.Core
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
_SansIOHTTPPolicyRunner allows a SansIOHTTPPolicy to stop it propagating pipeline exceptions, by returning
True
from its on_exception method. However, when a policy does this, _SansIOHTTPPolicyRunner raises UnboundLocalError:... which makes sense because an exception prevents the assignment:
azure-sdk-for-python/sdk/core/azure-core/azure/core/pipeline/_base.py
Lines 70 to 77 in 82175dc
I opened an issue rather than a PR because the fix requires some design. Should _SansIOHTTPPolicyRunner return a PipelineResponse with no
http_response
in this case?The text was updated successfully, but these errors were encountered: