unreal4u / telegram-api

Complete async capable Telegram bot API implementation for PHP7
https://github.com/unreal4u/telegram-api/wiki
MIT License
784 stars 172 forks source link

Generic error messages from API response #136

Closed DJTommek closed 2 years ago

DJTommek commented 2 years ago

Which version are you using?

New behavior: current master (revision e4fdf5fb94fe6e982dbc0a5a9f84174355c83df4) Old behavior: revision 3436f3b032ecd9bba62d088da0258e81c0370105 PHP version doesn't matter, tested with 7.2.33, 7.3.21, 7.4.9 and 8.0.9

Description of problem

It seems, that after PR #127 which migrates reactphp, there is no longer access to real error message from Telegram, but generic HTTP 400 error is returned instead.

Steps to reproduce incorrect behavior:

  1. clone repo and open terminal in cloned folder
  2. run composer install
  3. update BOT_TOKEN constant in examples/conf.php
  4. run php examples/get-chat-members-count.php

Description of error message: "HTTP status code 400 (Bad Request)"

Steps to reproduce old correct behavior:

  1. clone repo but checkout to 3436f3b032ecd9bba62d088da0258e81c0370105 revision (just before #127), then continue as usually

Description of error message: "Bad Request: chat not found"

Added attachments of Tracy logging which is interactive, so you can check all parameters across call stack or environment.

Because Github is not allowing updating HTML files, I uploaded them as .txt. Just rename them as .html and open in browser.

ping @Yoshi2889