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

Improve Error handling for inactive user login #546

Open
will-moore opened this issue Mar 25, 2024 · 1 comment
Open

Improve Error handling for inactive user login #546

will-moore opened this issue Mar 25, 2024 · 1 comment

Comments

@will-moore
Copy link
Member

See https://forum.image.sc/t/clearer-login-error-message-when-user-is-inactive/93936

When an Inactive user tries to login the message is not helpful...

Error: Connection not available, please check your user name and password.

Trying to trace this logic and error handling...

We first get SecurityViolation at https://github.com/ome/omero-py/blob/d76e17aa58ca755d239e9e8005712cd78239c62e/src/omero/gateway/__init__.py#L2185
because user is not in user group.

Then try to _createSession() again at https://github.com/ome/omero-py/blob/d76e17aa58ca755d239e9e8005712cd78239c62e/src/omero/gateway/__init__.py#L2203
but this time we don't get a SecurityViolation - instead we get

omero.ClientError Session already active. Create a new omero.client or closeSession()

but this isn't caught anywhere in the BlitzGateway - it is instead caught and ignored at

except Exception:

So the code that calls that at

conn = connector.create_connection(
doesn't know why the connection failed. It then generates the misleading error message above.

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/clearer-login-error-message-when-user-is-inactive/93936/2

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