|
|
@ -52,10 +52,10 @@ func wrapError(err error) error {
|
|
|
|
func extractOk(data []byte) error {
|
|
|
|
func extractOk(data []byte) error {
|
|
|
|
// Parse the error message as JSON
|
|
|
|
// Parse the error message as JSON
|
|
|
|
var tgramApiError struct {
|
|
|
|
var tgramApiError struct {
|
|
|
|
Ok bool `json:"ok"`
|
|
|
|
Ok bool `json:"ok"`
|
|
|
|
ErrorCode int `json:"error_code"`
|
|
|
|
ErrorCode int `json:"error_code"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Parameters map[string]interface{} `json:"parameters"`
|
|
|
|
Parameters map[string]interface{} `json:"parameters"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tgramApiError)
|
|
|
|
err := json.Unmarshal(data, &tgramApiError)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|