laravel-notification-channels / telegram

✈️ Telegram Notifications Channel for Laravel
https://laravel-notification-channels.com/telegram/
MIT License
989 stars 165 forks source link

add error handler to telegram message #201

Closed Hesammousavi closed 1 month ago

Hesammousavi commented 2 months ago

Problem Currently, when a user sends a message to a Telegram channel, handling errors can be challenging, making it difficult to take appropriate action when an exception occurs. This results in reduced flexibility for handling issues in real-time.

Solution This PR addresses the issue by introducing a mechanism to easily catch exceptions when sending messages via Telegram. It provides a way to define custom error-handling logic through a callback function, enabling developers to manage exceptions more effectively.

By offering this functionality, developers can now seamlessly react to errors, improving overall control and reliability of the notification process.

197

155

166

Hesammousavi commented 1 month ago

@putera @JayBizzle @JackEllis

irazasyed commented 1 month ago

Looks great. Can you please update the Available Methods section with this method?

irazasyed commented 1 month ago

Also, this should ideally be in the HasSharedLogic trait.

irazasyed commented 1 month ago

I'm adding this with other changes myself. You can test the master branch in sometime (credited as well).