Documentation ¶
Overview ¶
Package tgerr implements helpers for error handling.
Index ¶
Constants ¶
View Source
const ErrFloodWait = "FLOOD_WAIT"
ErrFloodWait is error type of "FLOOD_WAIT" error.
Variables ¶
This section is empty.
Functions ¶
func AsFloodWait ¶
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.
Types ¶
type Error ¶
type Error struct { Code int // 420 Message string // FLOOD_WAIT_3 Type string // FLOOD_WAIT Argument int // 3 }
Error represents RPC error returned as result to request.
func (*Error) IsCodeOneOf ¶
IsCodeOneOf returns true if error code is one of codes.
type FloodWaitOption ¶
type FloodWaitOption interface {
// contains filtered or unexported methods
}
FloodWaitOption configures flood wait.
func FloodWaitWithClock ¶
func FloodWaitWithClock(c clock.Clock) FloodWaitOption
FloodWaitWithClock sets time source for flood wait.
Click to show internal directories.
Click to hide internal directories.