Skip to content

Commit

Permalink
[ServiceBus] Docstring and Changelog adjustment (#11166)
Browse files Browse the repository at this point in the history
  • Loading branch information
YijunXieMS authored May 1, 2020
1 parent 505f7fe commit bfdc8e7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
9 changes: 6 additions & 3 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 7.0.0b2 (Unreleased)
## 7.0.0b2 (2020-05-04)

**New Features**

Expand All @@ -10,9 +10,12 @@
- Use `ServiceBusSender.schedule(messages, schedule_time_utc)` for scheduling messages.
- Use `ServiceBusSender.cancel_scheduled_messages(sequence_numbers)` for scheduled messages cancellation.
* `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.
* `BatchMessage.add()` and `ServiceBusSender.send()` raises `MessageContentTooLarge`, which is a subclass of `ValueError` if the content is over-sized.
* `ServiceBusReceiver.receive()` raises `ValueError` if the max_batch_size is greater than the prefetch of `ServiceBusClient`.
* `BatchMessage.add()` and `ServiceBusSender.send()` would raise `MessageContentTooLarge` if the content is over-sized.
* `ServiceBusReceiver.receive()` raises `ValueError` if its param `max_batch_size` is greater than param `prefetch` of `ServiceBusClient`.
* Added exception classes `MessageError`, `MessageContentTooLarge`, `ServiceBusAuthenticationError`.
- `MessageError`: when you send a problematic message, such as an already sent message or an over-sized message.
- `MessageContentTooLarge`: when you send an over-sized message. A subclass of `ValueError` and `MessageError`.
- `ServiceBusAuthenticationError`: on failure to be authenticated by the service.
* Removed exception class `InvalidHandlerState`.

**BugFixes**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def add(self, message):
:param message: The Message to be added to the batch.
:type message: ~azure.servicebus.Message
:rtype: None
:raises: :class:`ValueError`, when exceeding the size limit.
:raises: :class: ~azure.servicebus.exceptions.MessageContentTooLarge, when exceeding the size limit.
"""
message_size = message.message.get_message_encoded_size()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,14 @@ def send(self, message):
:param message: The ServiceBus message to be sent.
:type message: ~azure.servicebus.Message or ~azure.servicebus.BatchMessage or list[~azure.servicebus.Message]
:rtype: None
:raises: :class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to
send
:raises:
:class: ~azure.servicebus.exceptions.OperationTimeoutError if sending times out.
:class: `ValueError` if list of messages is provided and cannot fit in a batch.
:class: ~azure.servicebus.exceptions.MessageContentTooLarge if the size of the message is over
service bus frame size limit.
:class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to send
:class: ~azure.servicebus.exceptions.ServiceBusError when other errors happen such as connection
error, authentication error, and any unexpected errors.
It's also the top-level root class of above errors.
.. admonition:: Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,14 @@ async def send(self, message):
:param message: The ServiceBus message to be sent.
:type message: ~azure.servicebus.Message or ~azure.servicebus.BatchMessage or list[~azure.servicebus.Message]
:rtype: None
:raises: :class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to
send
:raises:
:class: ~azure.servicebus.exceptions.OperationTimeoutError if sending times out.
:class: `ValueError` if list of messages is provided and cannot fit in a batch.
:class: ~azure.servicebus.exceptions.MessageContentTooLarge if the size of the message is over
service bus frame size limit.
:class: ~azure.servicebus.exceptions.MessageSendFailed if the message fails to send
:class: ~azure.servicebus.exceptions.ServiceBusError when other errors happen such as connection
error, authentication error, and any unexpected errors.
It's also the top-level root class of above errors.
.. admonition:: Example:
Expand Down

0 comments on commit bfdc8e7

Please # to comment.