package tgerr
Import Path
github.com/gotd/td/tgerr (on go.dev)
Dependency Relation
imports 8 packages, and imported by 6 packages
Package-Level Type Names (total 4, in which 2 are exported)
Error represents RPC error returned as result to request.
// 3
// 420
// FLOOD_WAIT_3
// FLOOD_WAIT
(*Error) Error() string
IsCode reports whether error Code is equal to code.
IsCodeOneOf returns true if error code is one of codes.
IsOneOf returns true if error type is in tt.
IsType reports whether error has type t.
extractArgument extracts Type and Argument from Message.
*Error : error
func As(err error) (rpcErr *Error, ok bool)
func AsType(err error, t string) (rpcErr *Error, ok bool)
func New(code int, msg string) *Error
FloodWaitOption configures flood wait.
( FloodWaitOption) apply(o *floodWaitOptions)
floodWaitOptionFunc
func FloodWaitWithClock(c clock.Clock) FloodWaitOption
func FloodWait(ctx context.Context, err error, opts ...FloodWaitOption) (bool, error)
Package-Level Functions (total 8, all are exported)
As extracts *Error from err if possible.
AsFloodWait returns wait duration and true boolean if err is
the "FLOOD_WAIT" error.
Client should wait for that duration before issuing new requests with
same method.
AsType returns *Error from err if rpc error type is t.
FloodWait sleeps required duration and returns true if err is FLOOD_WAIT
or false and context or original error otherwise.
FloodWaitWithClock sets time source for flood wait.
Is returns true if err type is t.
IsCode returns true of error code is as provided.
New creates new *Error from code and message, extracting argument
and type.
Package-Level Constants (only one, which is exported)
ErrFloodWait is error type of "FLOOD_WAIT" error.
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |