PetterKraabol / Twitch-Python

Object-oriented Twitch API for Python developers
https://pypi.org/project/twitch-python
MIT License
214 stars 37 forks source link

Add IRC attribute to help error handling #50

Open RduMarais opened 1 year ago

RduMarais commented 1 year ago

As mentioned in several issues, it would be nice to have a way to listen for the login failure. In this PR I propose a very simple way to handle this : by adding an exception attribute to a chat.irc object, all users of the lib can listen for this attribute to be set with a TwitchChatError and raise this error.

This code does not conflict with the current state of the lib since it does not raise the Exception itself, but rather let the developpers listen for the event and raise or handle this themselves, therefore no compatibility issues.

This is follwowing the issue https://github.com/PetterKraabol/Twitch-Python/issues/32#issue-812267731

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information