HTTP 400 · Bad Request
INTERDC_X_CALL_RICH_ERROR
A rich error occurred while communicating with DC %v.
HTTP 400
Server / Internal
Parameterized
When & why it happens
A rich error occurred while communicating with DC %v. Treated by gogram as a regular API error; inspect ErrResponseCode.Message for the exact code.
Parameterized error
The wire code carries a parameter on its tail (literal you'll see: INTERDC_42_CALL_RICH_ERROR). Gogram parses it out and stores it on ErrResponseCode.AdditionalInfo with the right type.
Handling in gogram
Surfaced as *gogram.ErrResponseCode. Match on the message:
if err, ok := err.(*gogram.ErrResponseCode); ok {
if strings.HasPrefix(err.Message, "INTERDC_X_CALL_RICH_ERROR") {
secs := err.AdditionalInfo.(int)
time.Sleep(time.Duration(secs) * time.Second)
// retry
}
}
Related errors
API_ID_INVALIDAPI ID invalid.API_ID_PUBLISHED_FLOODThis API ID was published somewhere, you can't use it now.CONNECTION_API_ID_INVALIDThe provided API id is invalid.CONNECTION_APP_VERSION_EMPTYApp version is empty.CONNECTION_DEVICE_MODEL_EMPTYDevice model empty.CONNECTION_LANG_PACK_INVALIDThe specified language pack is not valid.CONNECTION_LAYER_INVALIDLayer invalid.CONNECTION_NOT_INITEDConnection not initialized.CONNECTION_SYSTEM_EMPTYConnection system empty.CONNECTION_SYSTEM_LANG_CODE_EMPTYThe system language string was empty during connection.INTERDC_X_CALL_ERRORAn error occurred while communicating with DC %v.TIMEOUTA timeout occurred while fetching data from the worker.