BotError<CTX extends Context> class

A bot error that occurred during update processing.

This class wraps errors that occur during middleware execution or update processing, providing additional context information that can be useful for debugging and error handling.

The error includes the original error, stack trace, and the context in which the error occurred (if available).

Inheritance

Constructors

BotError({required Object error, required StackTrace? stackTrace, CTX? ctx})
Creates a new bot error.
BotError.fromAPI(Object error, StackTrace stackTrace, CTX? ctx)
Creates a bot error from an exception during API call.
factory
BotError.fromFetcher(Object error, StackTrace stackTrace)
Creates a bot error from an exception during update fetching.
factory
BotError.fromMiddleware(Object error, StackTrace stackTrace, CTX? ctx)
Creates a bot error from an exception in middleware.
factory

Properties

chatId ID?
Gets the chat ID if available.
no setter
ctx → CTX?
The context in which the error occurred, if available.
final
description String?
Optional description.
finalinherited
error Object
The original error that occurred.
final
hasContext bool
Checks if context is available.
no setter
hashCode int
The hash code for this object.
no setterinherited
message String
The error message.
finalinherited
messageId int?
Gets the message ID if available.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace
Optional stack trace.
finalinherited
type TeleverseExceptionType
The type of the exception.
finalinherited
updateId int?
Gets the update ID if context is available.
no setter
userId int?
Gets the user ID if available.
no setter

Methods

getOriginalErrorAs<T>() → T?
Gets the original error cast to a specific type.
isOfType<T>() bool
Checks if this error is of a specific type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of the exception.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited