-
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 BatchBufferOverflowException
- Loading branch information
1 parent
001aedd
commit 26b66a9
Showing
3 changed files
with
36 additions
and
2 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,14 @@ | ||
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
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