Open will-moore opened 4 months ago
I tried str(err)
for both cases at https://github.com/ome/omero-web/issues/481#issuecomment-1959903979 and it gave sub-optimal results.
Not sure exactly what the difference is between omero.CmdError
and omero.cmd.ERR
!
@sbesson updated as suggested to use str(omero.CmdError)
and str(omero.cmd.ERR.name)
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). I could try guessing a few, but not sure where to start
@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 message
attribute.
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 https://github.com/ome/omero-web/issues/481#issuecomment-1959903979