FILE / ScuroNeko/Laniakea

tgapi/errors.go

Исходный файл и его история в репозитории.
FILE f03a081ed6ad0d7aa86944cacb94ff61573c29bd
Files
Laniakea/tgapi/errors.go
T
ScuroNeko f03a081ed6
Golang lint / lint (pull_request) Successful in 1m20s
Golang lint / lint (push) Successful in 4m8s
(new): rich message support
(fix): runtime reliability
(tests): regression coverage
(doc): v1.1 release notes
2026-08-12 16:34:44 +03:00

36 lines
1.0 KiB
Go

package tgapi
import (
"errors"
"fmt"
)
// ErrPoolUnexpected reports an unexpected result type returned from the worker pool.
var ErrPoolUnexpected = errors.New("unexpected response from pool")
// ErrPoolQueueFull reports that the internal request queue is full.
var ErrPoolQueueFull = errors.New("worker pool queue full")
// ErrPoolStopped reports that a request was submitted after the worker pool stopped.
var ErrPoolStopped = errors.New("worker pool stopped")
// ErrRichMessageDraftUploadUnsupported reports a direct file upload attempted for a rich draft.
//
// Since: Bot API 10.2
var ErrRichMessageDraftUploadUnsupported = errors.New("sendRichMessageDraft does not support direct file uploads")
// ResponseError reports an unsuccessful Telegram API response.
type ResponseError struct {
Code int
Description string
Parameters *ResponseParameters
}
// Error returns the Telegram API error code and description.
func (e *ResponseError) Error() string {
if e == nil {
return "<nil>"
}
return fmt.Sprintf("[%d] %s", e.Code, e.Description)
}