python-redmine
python-redmine copied to clipboard
Catch AuthError
Hello, I'm trying to catch an Auth Error when I try to make this:
redmine = Redmine( connection.REDMINE_URL,
version=connection.REDMINE_VERSION,
username=connection.REDMINE_USER,
password=connection.REDMINE_PASSWORD,
requests={'verify': False}
)
Of course, it returns :
...
...
...
raise exceptions.AuthError
redminelib.exceptions.AuthError: Invalid authentication details
When credentials are incorrect, I'd like to catch this error. ¿What can I do?
from redminelib import exceptions
try:
redmine = Redmine(.....)
except exceptions.AuthError:
print('ooops, we just caught AuthError')
that's basically how you would catch any other Python exception
Closing this due to inactivity.