tg/errors.go

34 lines
1 KiB
Go
Raw Permalink Normal View History

2023-08-19 09:12:26 +03:00
package tg
import (
"errors"
"fmt"
)
type WrongUpdateType struct {
Type string
}
var (
2023-08-15 16:02:14 +03:00
ScreenNotExistErr = errors.New("screen does not exist")
SessionNotExistErr = errors.New("session does not exist")
KeyboardNotExistErr = errors.New("keyboard does not exist")
NotAvailableErr = errors.New("the context is not available")
EmptyKeyboardTextErr = errors.New("got empty text for a keyboard")
ActionNotDefinedErr = errors.New("action was not defined")
MapCollisionErr = errors.New("map collision occured")
2023-09-26 17:13:31 +03:00
ContextNotExistErr = errors.New("the context does not exist")
StatusCodeErr = errors.New("not success response status code")
2024-01-17 16:39:52 +03:00
NotSendErr = errors.New("could not send message")
NoWidgetForScreenErr = errors.New("no widget defined for the screen")
EmptyCompoErr = errors.New("empty component")
EmptyWidgetErr = errors.New("empty widget")
)
func (wut WrongUpdateType) Error() string {
if wut.Type == "" {
return "wrong update type"
}
return fmt.Sprintf("wrong update type '%s'", wut.Type)
}