Errors
606 RPC errors gogram knows about, grouped by HTTP-style status. Each entry has its own page with the wire code, what the server says, and when & why it usually fires.
How gogram surfaces them
In Go these come back as *gogram.ErrResponseCode. Match on .Message for the exact code, read .Description for the formatted human text, and inspect .AdditionalInfo for the parsed integer when the code ends in _X.
Source: errors.go.
Filter
HTTP 303 — See Other (5)
The auth key/account lives on a different DC. The gogram client transparently reconnects and replays the request.
HTTP 400 — Bad Request (528)
The server rejected the request payload — a parameter is missing, malformed, or fails a server-side invariant.
HTTP 401 — Unauthorized (17)
The session/auth key is no longer valid. The user must sign in again.
HTTP 403 — Forbidden (47)
The current user lacks permission to perform the action against this peer.
HTTP 404 — Not Found (2)
The referenced resource (peer, message, file) does not exist.
HTTP 420 — Flood (3)
The account has been rate-limited. Sleep for the supplied seconds before retrying.
HTTP 500 — Internal Server Error (4)
The server hit a transient internal problem. Retry with backoff.
MTProto bad-message notifications (11)
Service-message error codes returned by the MTProto transport itself, before any RPC dispatch happens — usually the client's clock is wrong, the session salt expired, or a message id collided. Gogram surfaces these as *BadMsgError.
| Code | Description |
|---|---|
| 16 | msg_id too low (most likely, client time is wrong; it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted) |
| 17 | msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id |
| 18 | incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4) |
| 19 | container msg_id is the same as msg_id of a previously received message (this must never happen) |
| 20 | message too old, and it cannot be verified whether the server has received a message with this msg_id or not |
| 32 | msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno) |
| 33 | msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno) |
| 34 | an even msg_seqno expected (irrelevant message), but odd received |
| 35 | odd msg_seqno expected (relevant message), but even received |
| 48 | incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it) |
| 64 | invalid container |