Skip to content
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

fix UnboundLocalError #19744

Merged
merged 21 commits into from
Nov 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
xiangyan99 committed Oct 25, 2021
commit ca5dd99ba79bf5e9c866aae8048139b6b9e6a318
2 changes: 1 addition & 1 deletion sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

### Breaking Changes

- Do not honor `policy.on_exception` returning `True` to stop raising any longer.
- SansIOHTTPPolicy.on_exception returns None instead of bool.

### Bugs Fixed

13 changes: 0 additions & 13 deletions sdk/core/azure-core/samples/test_example_sansio.py
Original file line number Diff line number Diff line change
@@ -167,16 +167,3 @@ def example_proxy_policy():
# You can also configure proxies by setting the environment variables
# HTTP_PROXY and HTTPS_PROXY.
# [END proxy_policy]

def example_on_exception():
policy = SansIOHTTPPolicy()
request = HttpRequest("GET", "https://bing.com")
# [START on_exception]
try:
response = policy.on_request(request)
except Exception:
policy.on_exception(request)

# or use
exc_type, exc_value, exc_traceback = sys.exc_info()
# [END on_exception]