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.
View Source
const ErrPremiumFloodWait = "FLOOD_PREMIUM_WAIT"
ErrPremiumFloodWait is error type of "FLOOD_PREMIUM_WAIT" error.
Variables ¶
View Source
var FloodWaitErrors = []string{ErrFloodWait, ErrPremiumFloodWait}
FloodWaitErrors is a list of errors that are considered as flood wait.
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.