class ChatMarkdownError[E = Never]
A call that did not deliver its whole input.
postedis text the platform confirmed,uncertaintext sent in a write that failed"uncertain"and was never confirmed since,remainingtext never sent:posted, thenuncertain, thenremainingis the input.remaining_fenceis the line that opened the code fenceremainingstarts in, when it does: text sent later starts with it and a newline.causeis a write'sChatError, the deltas' error, orOverflowCause.
It carries message text, so message, str() and to_json leave
the text out.
Attributes#
| Attribute | Type | Description |
|---|---|---|
posted | tuple[Part, ...] | |
remaining | str | |
cause | Cause[E] | |
remaining_fence | str | None = None | |
uncertain | str | None = None | |
message | str |
Functions#
__init__#
__init__(posted, remaining, cause, remaining_fence=None, uncertain=None) -> None| Parameter | Type | Description |
|---|---|---|
posted | tuple[Part, ...] | |
remaining | str | |
cause | Cause[E] | |
remaining_fence | str | None = None | |
uncertain | str | None = None |
to_json#
to_json() -> objectThe error without its message text.
Returns object
def to_json(self) -> object:
"""The error without its message text."""
cause = self.cause
return {
"_tag": "ChatMarkdownError",
"posted": [
{"messageId": p.message_id, "kind": p.kind, "transport": p.transport}
for p in self.posted
],
"cause": {"_tag": "Chat", "error": cause.error.to_json()}
if isinstance(cause, ChatCause)
else {"_tag": cause._tag}, # pyright: ignore[reportPrivateUsage]
}