-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add raise BatchBufferOverflowException (#1989)
* feat: add raise BatchBufferOverflowException * Update producer.py --------- Co-authored-by: Pastukhov Nikita <[email protected]>
- Loading branch information
1 parent
195035e
commit a728ba7
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from faststream.exceptions import FastStreamException | ||
|
||
|
||
class BatchBufferOverflowException(FastStreamException): | ||
"""Exception raised when a buffer overflow occurs when adding a new message to the batches.""" | ||
|
||
def __init__(self, | ||
message_position: int) -> None: | ||
self.message_position = message_position | ||
|
||
def __str__(self) -> str: | ||
return f"The batch buffer is full. The position of the message" \ | ||
f" in the transferred collection at which the overflow occurred: {self.message_position}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters