-
Notifications
You must be signed in to change notification settings - Fork 31
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
get strings from omero.cmd.ERR and omero.CmdError correctly #534
base: master
Are you sure you want to change the base?
get strings from omero.cmd.ERR and omero.CmdError correctly #534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage of str(omero.CmdError)
matches the intent of this API introduced in ome/omero-py#151
For the omero.cmd.ERR
handling, as an element of comparison the CLI implementation in https://github.com/ome/omero-py/blob/0dc60bd67a5f9281e2063a0a3aeeaa119c14447d/src/omero/cli.py#L1907-L1927 uses rsp.name
as the error message and rsp.parameters
as the report. Would it make sense to align the behavior in OMERO.web
I tried |
dfe2091
to
d328a0c
Compare
@sbesson updated as suggested to use |
cc @knabar This is not an urgent PR, but it is a trivial fix so could maybe get reviewed and included in the next release? |
@will-moore I have not had a chance to get back to those. For both updates, do you have scenarios that would allow to reproduce the original errors and asses the impact of the changes functionally? |
@sbesson No, unfortunately I don't have scenarios to reproduce those errors. We only have stack traces from QA, but don't know what caused them (difficult to understand from the stack traces themselves). |
@will-moore I'm curious if these missing attributes existed in the past, and if so, when they were removed or renamed. Discussed with @sbesson a bit and he pointed out this could be related to Python 2/3 upgrades as well. Overall I feel we need a bit more investigation, so I'd like to hold off on this one until 5.26.0, which could come fairly soon anyway. |
@knabar I don't think they've ever existed. It was just assumed that an exception would have a |
Fixes #481
This fixes 2 similar bugs where we're handling
omero.CmdError
oromero.cmd.ERR
objects and converting into strings.Both were previously failing with
AttributeError: 'ERR' object has no attribute 'message'
.Changes based on using the appropriate attributes as tested at #481 (comment)