Skip to content

Commit 46fa4a7

Browse files
authored
update release date and doc (Azure#21969)
1 parent 118fef8 commit 46fa4a7

File tree

4 files changed

+47
-28
lines changed

4 files changed

+47
-28
lines changed

sdk/core/azure-core/CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Release History
22

3-
## 1.20.2 (Unreleased)
4-
5-
### Features Added
3+
## 1.21.0 (2021-12-02)
64

75
### Breaking Changes
86

@@ -12,8 +10,6 @@
1210

1311
- Add response body to string representation of `HttpResponseError` if we're not able to parse out information #21800
1412

15-
### Other Changes
16-
1713
## 1.20.1 (2021-11-08)
1814

1915
### Bugs Fixed

sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ from azure.core.pipeline.policies import (
469469
| | | retry_status | x | x | How many times to retry on bad status codes. Default value is `3`. |
470470
| | | retry_backoff_factor | x | x | A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` seconds. If the backoff_factor is 0.1, then the retry will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is `0.8`. |
471471
| | | retry_backoff_max | x | x | The maximum back off time. Default value is `120` seconds (2 minutes). |
472-
| | | retry_mode | x | x | Fixed or exponential delay between attemps, default is `exponential`. |
472+
| | | retry_mode | x | x | Fixed or exponential delay between attempts, default is `exponential`. |
473473
| | | timeout | x | x | Timeout setting for the operation in seconds, default is `604800s` (7 days). |
474474
| AsyncRetryPolicy | AsyncHTTPPolicy | | | | |
475475
| | | retry_total | x | x | Total number of retries to allow. Takes precedence over other counts. Default value is `10`. |
@@ -478,7 +478,7 @@ from azure.core.pipeline.policies import (
478478
| | | retry_status | x | x | How many times to retry on bad status codes. Default value is `3`. |
479479
| | | retry_backoff_factor | x | x | A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` seconds. If the backoff_factor is 0.1, then the retry will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is `0.8`. |
480480
| | | retry_backoff_max | x | x | The maximum back off time. Default value is `120` seconds (2 minutes). |
481-
| | | retry_mode | x | x | Fixed or exponential delay between attemps, default is exponential. |
481+
| | | retry_mode | x | x | Fixed or exponential delay between attempts, default is exponential. |
482482
| | | timeout | x | x | Timeout setting for the operation in seconds, default is `604800s` (7 days). |
483483

484484
### The Pipeline

sdk/core/azure-core/README.md

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you are a client library developer, please reference [client library develope
1010

1111
## _Disclaimer_
1212

13-
_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
13+
_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, please refer to <https://github.com/Azure/azure-sdk-for-python/issues/20691>_
1414

1515
## Getting started
1616

@@ -24,56 +24,61 @@ you can find it [here](https://pypi.org/project/azure-core/).
2424
### Azure Core Library Exceptions
2525

2626
#### AzureError
27+
2728
AzureError is the base exception for all errors.
29+
2830
```python
2931
class AzureError(Exception):
3032
def __init__(self, message, *args, **kwargs):
31-
self.inner_exception = kwargs.get('error')
33+
self.inner_exception = kwargs.get("error")
3234
self.exc_type, self.exc_value, self.exc_traceback = sys.exc_info()
3335
self.exc_type = self.exc_type.__name__ if self.exc_type else type(self.inner_exception)
3436
self.exc_msg = "{}, {}: {}".format(message, self.exc_type, self.exc_value) # type: ignore
3537
self.message = str(message)
38+
self.continuation_token = kwargs.get("continuation_token")
3639
super(AzureError, self).__init__(self.message, *args)
3740
```
3841

3942
*message* is any message (str) to be associated with the exception.
4043

4144
*args* are any additional args to be included with exception.
4245

43-
*kwargs* are keyword arguments to include with the exception. Use the keyword *error* to pass in an internal exception.
46+
*kwargs* are keyword arguments to include with the exception. Use the keyword *error* to pass in an internal exception and *continuation_token* for a token reference to continue an incomplete operation.
4447

4548
**The following exceptions inherit from AzureError:**
4649

4750
#### ServiceRequestError
51+
4852
An error occurred while attempt to make a request to the service. No request was sent.
4953

5054
#### ServiceResponseError
55+
5156
The request was sent, but the client failed to understand the response.
5257
The connection may have timed out. These errors can be retried for idempotent or safe operations.
5358

5459
#### HttpResponseError
60+
5561
A request was made, and a non-success status code was received from the service.
62+
5663
```python
5764
class HttpResponseError(AzureError):
5865
def __init__(self, message=None, response=None, **kwargs):
5966
self.reason = None
6067
self.response = response
6168
if response:
6269
self.reason = response.reason
63-
message = "Operation returned an invalid status code '{}'".format(self.reason)
64-
try:
65-
try:
66-
if self.error.error.code or self.error.error.message:
67-
message = "({}) {}".format(
68-
self.error.error.code,
69-
self.error.error.message)
70-
except AttributeError:
71-
if self.error.message: #pylint: disable=no-member
72-
message = self.error.message #pylint: disable=no-member
73-
except AttributeError:
74-
pass
70+
self.status_code = response.status_code
71+
self.error = self._parse_odata_body(ODataV4Format, response) # type: Optional[ODataV4Format]
72+
if self.error:
73+
message = str(self.error)
74+
else:
75+
message = message or "Operation returned an invalid status '{}'".format(
76+
self.reason
77+
)
78+
7579
super(HttpResponseError, self).__init__(message=message, **kwargs)
7680
```
81+
7782
*message* is the HTTP response error message (optional)
7883

7984
*response* is the HTTP response (optional).
@@ -83,25 +88,37 @@ class HttpResponseError(AzureError):
8388
**The following exceptions inherit from HttpResponseError:**
8489

8590
#### DecodeError
86-
An error raised during response deserialization.
91+
92+
An error raised during response de-serialization.
93+
94+
#### IncompleteReadError
95+
96+
An error raised if peer closes the connection before we have received the complete message body.
8797

8898
#### ResourceExistsError
99+
89100
An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.
90101

91102
#### ResourceNotFoundError
92-
An error response, typically triggered by a 412 response (for update) or 404 (for get/post).
93103

94-
#### ClientAuthenticationError
95-
An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.
104+
An error response, typically triggered by a 412 response (for update) or 404 (for get/post).
96105

97106
#### ResourceModifiedError
107+
98108
An error response with status code 4xx, typically 412 Conflict. This will not be raised directly by the Azure core pipeline.
99109

100110
#### ResourceNotModifiedError
111+
101112
An error response with status code 304. This will not be raised directly by the Azure core pipeline.
102113

114+
#### ClientAuthenticationError
115+
116+
An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.
117+
103118
#### TooManyRedirectsError
119+
104120
An error raised when the maximum number of redirect attempts is reached. The maximum amount of redirects can be configured in the RedirectPolicy.
121+
105122
```python
106123
class TooManyRedirectsError(HttpResponseError):
107124
def __init__(self, history, *args, **kwargs):
@@ -117,14 +134,17 @@ class TooManyRedirectsError(HttpResponseError):
117134
*kwargs* are keyword arguments to include with the exception.
118135

119136
#### StreamConsumedError
137+
120138
An error thrown if you try to access the stream of `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` once
121139
the response stream has been consumed.
122140

123141
#### StreamClosedError
142+
124143
An error thrown if you try to access the stream of the `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` once
125144
the response stream has been closed.
126145

127146
#### ResponseNotReadError
147+
128148
An error thrown if you try to access the `content` of `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` before
129149
reading in the response's bytes first.
130150

@@ -153,7 +173,7 @@ When calling the methods, some properties can be configured by passing in as kwa
153173
| retry_status | How many times to retry on bad status codes. Default value is `3`. |
154174
| retry_backoff_factor | A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` seconds. If the backoff_factor is 0.1, then the retry will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is `0.8`. |
155175
| retry_backoff_max | The maximum back off time. Default value is `120` seconds (2 minutes). |
156-
| retry_mode | Fixed or exponential delay between attemps, default is `Exponential`. |
176+
| retry_mode | Fixed or exponential delay between attempts, default is `Exponential`. |
157177
| timeout | Timeout setting for the operation in seconds, default is `604800`s (7 days). |
158178
| connection_timeout | A single float in seconds for the connection timeout. Defaults to `300` seconds. |
159179
| read_timeout | A single float in seconds for the read timeout. Defaults to `300` seconds. |
@@ -172,6 +192,7 @@ The async transport is designed to be opt-in. [AioHttp](https://pypi.org/project
172192
#### MatchConditions
173193

174194
MatchConditions is an enum to describe match conditions.
195+
175196
```python
176197
class MatchConditions(Enum):
177198
Unconditionally = 1
@@ -184,6 +205,7 @@ class MatchConditions(Enum):
184205
#### CaseInsensitiveEnumMeta
185206

186207
A metaclass to support case-insensitive enums.
208+
187209
```python
188210
from enum import Enum
189211
from six import with_metaclass
@@ -211,6 +233,7 @@ foo = Foo(
211233
```
212234

213235
## Contributing
236+
214237
This project welcomes contributions and suggestions. Most contributions require
215238
you to agree to a Contributor License Agreement (CLA) declaring that you have
216239
the right to, and actually do, grant us the rights to use your contribution.

sdk/core/azure-core/azure/core/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
VERSION = "1.20.2"
12+
VERSION = "1.21.0"

0 commit comments

Comments
 (0)