Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRC login error handling #32

Open
HoodyH opened this issue Feb 19, 2021 · 2 comments
Open

IRC login error handling #32

HoodyH opened this issue Feb 19, 2021 · 2 comments

Comments

@HoodyH
Copy link

HoodyH commented Feb 19, 2021

hi, it would be cool if you rise an error when there is an auth failure.

on the irc.py line 36

logging.fatal('IRC authentication error: ' + text or '')
#return
raise Exception('authentication error') 

even better if you create an exceptions.py file:

class AuthenticationError(Exception)
    pass
logging.fatal('IRC authentication error: ' + text or '')
raise AuthenticationError

So we can handle it, renewing the token or skipping the login.
In my case im trying to handle multiple bots so its usefull

ty

@RduMarais
Copy link

+1
This would be super useful indeed, in order to catch error and create renewal process.
Out of curiosity, @HoodyH did you find a way to catch the error without modifying the lib ?
thx

@RduMarais
Copy link

Had a look into it, and the fix you proposed seems trivial but actually doesn't work because the library is threaded, so the exception is raised in the context of a child thread, but cannot be caught in the main thread. I look forward into it, but i'd be happy to get any insight on another (more pythonic) way to catch this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants