Closed BoShurik closed 1 year ago
You must handle excaption and correct your code
disabling logger and keep using deprecated function not a good idea by the way the code suggest you using enableAttributeMapping()
function instead
What @mtalaeii said, however if you really have issues with the strict error handler you can always overwrite it after instantiating API.
You must handle excaption
It's not an exception, it's deprecation warning. MadelineProto
converts this warning to the exception.
disabling logger and keep using deprecated function not a good idea by the way the code suggest you using enableAttributeMapping() function instead
It was just an example. And often there are no suggestion like in this example.
Symfony often use this method to trigger deprecation warning and collect them in separate log file. MadelineProto
brakes this behavior by adding own handlers and converting warning to exceptions.
Deprecation warnings are there to be solved, not to be ignored :)
Deprecation warnings are there to be solved, not to be ignored :)
Yes, but I would prefer application did not crash in runtime because of that ;)
At least, it would be good to ignore silenced exception.
E.g. symfony uses it in symfony/var-dumper. So messages with \danog\MadelineProto\TL\Types\Bytes
cant be dumped because of strict error handler
You can re-set the error handler after instantiating madelineproto (even if it's generally not recommended)
Yes, I can. But it reduces DX.
Anyway, thanks for the quick reply and the great project!
For example, we have a
"symfony/validator": "^6.4@dev"
dependency with this code:It works fine.
enableAnnotationMapping
in this version is deprecated, but silenced and can be catch by logger.If we add
MadelineProto
to this script:We got an exception
It would be great to have an ability to disable this behaviour