Skip to content

Commit bfdc8e7

Browse files
authored
[ServiceBus] Docstring and Changelog adjustment (#11166)
1 parent 505f7fe commit bfdc8e7

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

sdk/servicebus/azure-servicebus/CHANGELOG.md

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

3-
## 7.0.0b2 (Unreleased)
3+
## 7.0.0b2 (2020-05-04)
44

55
**New Features**
66

@@ -10,9 +10,12 @@
1010
- Use `ServiceBusSender.schedule(messages, schedule_time_utc)` for scheduling messages.
1111
- Use `ServiceBusSender.cancel_scheduled_messages(sequence_numbers)` for scheduled messages cancellation.
1212
* `ServiceBusSender.send()` can now send a list of messages in one call, if they fit into a single batch. If they do not fit a `ValueError` is thrown.
13-
* `BatchMessage.add()` and `ServiceBusSender.send()` raises `MessageContentTooLarge`, which is a subclass of `ValueError` if the content is over-sized.
14-
* `ServiceBusReceiver.receive()` raises `ValueError` if the max_batch_size is greater than the prefetch of `ServiceBusClient`.
13+
* `BatchMessage.add()` and `ServiceBusSender.send()` would raise `MessageContentTooLarge` if the content is over-sized.
14+
* `ServiceBusReceiver.receive()` raises `ValueError` if its param `max_batch_size` is greater than param `prefetch` of `ServiceBusClient`.
1515
* Added exception classes `MessageError`, `MessageContentTooLarge`, `ServiceBusAuthenticationError`.
16+
- `MessageError`: when you send a problematic message, such as an already sent message or an over-sized message.
17+
- `MessageContentTooLarge`: when you send an over-sized message. A subclass of `ValueError` and `MessageError`.
18+
- `ServiceBusAuthenticationError`: on failure to be authenticated by the service.
1619
* Removed exception class `InvalidHandlerState`.
1720

1821
**BugFixes**

sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def add(self, message):
340340
:param message: The Message to be added to the batch.
341341
:type message: ~azure.servicebus.Message
342342
:rtype: None
343-
:raises: :class:`ValueError`, when exceeding the size limit.
343+
:raises: :class: ~azure.servicebus.exceptions.MessageContentTooLarge, when exceeding the size limit.
344344
"""
345345
message_size = message.message.get_message_encoded_size()
346346

sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_sender.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,14 @@ def send(self, message):
301301
:param message: The ServiceBus message to be sent.
302302
:type message: ~azure.servicebus.Message or ~azure.servicebus.BatchMessage or list[~azure.servicebus.Message]
303303
:rtype: None
304-
:raises: :class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to
305-
send
304+
:raises:
306305
:class: ~azure.servicebus.exceptions.OperationTimeoutError if sending times out.
307-
:class: `ValueError` if list of messages is provided and cannot fit in a batch.
306+
:class: ~azure.servicebus.exceptions.MessageContentTooLarge if the size of the message is over
307+
service bus frame size limit.
308+
:class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to send
309+
:class: ~azure.servicebus.exceptions.ServiceBusError when other errors happen such as connection
310+
error, authentication error, and any unexpected errors.
311+
It's also the top-level root class of above errors.
308312
309313
.. admonition:: Example:
310314

sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,14 @@ async def send(self, message):
244244
:param message: The ServiceBus message to be sent.
245245
:type message: ~azure.servicebus.Message or ~azure.servicebus.BatchMessage or list[~azure.servicebus.Message]
246246
:rtype: None
247-
:raises: :class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to
248-
send
247+
:raises:
249248
:class: ~azure.servicebus.exceptions.OperationTimeoutError if sending times out.
250-
:class: `ValueError` if list of messages is provided and cannot fit in a batch.
249+
:class: ~azure.servicebus.exceptions.MessageContentTooLarge if the size of the message is over
250+
service bus frame size limit.
251+
:class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to send
252+
:class: ~azure.servicebus.exceptions.ServiceBusError when other errors happen such as connection
253+
error, authentication error, and any unexpected errors.
254+
It's also the top-level root class of above errors.
251255
252256
.. admonition:: Example:
253257

0 commit comments

Comments
 (0)