Skip to content

ErrorException in TelegramLog.php #413

@chuv1

Description

@chuv1

I finished with my own crash notifier, based on this comment and curl request to api endpoint in case of errors. It notifies me by bot itself about Exceptions in code.

So it started to notify my about

ErrorException - vsprintf(): Too few arguments;
File: /bla-bla-bla/vendor/longman/telegram-bot/src/TelegramLog.php; Line: 292;

when message text contains percent sign.
Incoming message example (cleaned for privacy):

array (
  'update_id' => 408xxxxxx,
  'message' => 
  array (
    'message_id' => 4xxxx,
    'from' => 
    array (
      'id' => 8xxxx,
      'first_name' => 'Kxxxx',
      'last_name' => 'Nxxxxxxxx',
      'username' => 'xxxxxx',
    ),
    'chat' => 
    array (
      'id' => -1001xxxxxxxxxx,
      'title' => 'xxxxxxx',
      'username' => 'xxxxxxxx',
      'type' => 'supergroup',
    ),
    'date' => xxxxxxxxxx,
    'text' => 'Помню только 100% качество, уникальную скидку, кучу подарков, и это ещё не всё, позвоните прямо сейчас и…',
  ),
)

and another one

array (
  'update_id' => 408xxxxxx,
  'message' => 
  array (
    'message_id' => 3xxxxxx,
    'from' => 
    array (
      'id' => 1xxxxxxxx,
      'first_name' => 'Mxxxxxxx',
      'username' => 'xxxxxxxx',
    ),
    'chat' => 
    array (
      'id' => -1001xxxxxxxxx,
      'title' => 'xxxxxxxxx',
      'username' => 'xxxxxxxxx',
      'type' => 'supergroup',
    ),
    'date' => xxxxxxxxxx,
    'text' => 'В результате естественного отбора отфильтровалось  3-5 удобоваримых и удовлетворяющих мои нужды на 99,9(9)%  интерфейса , зачем мне их 44 , 144? Зачем мне из менять и перебирать? Я конечно понимаю, что среди овер7млрд. человек найдутся люди или даже группа людей кому этот процесс доставляет удовольствие или может у них хобби такое... я не из них ) Про авиасейлс не совсем понял... ',
  ),
)

PS. I'm using 0.39 version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions