-
Notifications
You must be signed in to change notification settings - Fork 102
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
cli: error code discovery #6003
Conversation
Suggested by Damir, a few additional methods on the BaseControl class permit discovering all errors codes for available plugins. Example output for the state of this commit: $ bin/omero errors 123 admin NOT_WINDOWS 'Not Windows' 200 admin SETUP 'Error during service user set up: (%s) %s' 201 admin RUNNING '%s is already running. Use stop first' 201 server NO_CONFIG 'No --Ice.Config provided' 202 admin NO_SERVICE '%s service deleted.' 300 admin BAD_CONFIG 'Bad configuration: No IceGrid.Node.Data property' 400 admin WIN_CONFIG '%s is not in this directory. Aborting... ...' 666 admin NO_WIN32 'Could not import win32service and/or win32evtlogutil' see: https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=8676&p=20525#p20525
Addition of
|
Looking at it, overall 👍 about the beginning of the rationalization of these codes. A couple of immediate feedback from pure code review while considering the extension of decoupled CLI plugins to implement this functionality
|
I thought about that, but that leads to a good deal of verbosity.
It'd be a different approach. |
|
I think the report format gives a good indication of what is going on |
@sbesson : any thoughts? Guess I'm trying to avoid pinning us down to the implementation for the moment. We agree to not change:
in a breaking manner, introducing Error2 and friends if need be. |
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.
I went through the code once again. Overall the new API should keep existing code backwards-compatible i.e. plugins (core or decoupled) should be able to ignore the new API and use self.ctx.die()
as previously. When implementing the new API, I think add_error
and raise_error
are the two main ones that need to be implemented.
At this stage, I am tempted to just get this in and start testing with decoupled plugins e.g. omero-cli-render
once OMERO 5.5 is out. Worst case, it turns out to be inefficient and we can deprecate the new Errors
class as well as the new methods.
There is also a submodule update as part of the PR, is that on purpose?
Definitely not. Force-pushed away. Otherwise, 👍 |
In that case, do we mark it as "experimental"? |
I defer to you guys. I'm happy to support this, but unless we mark it as "Experimental" we should all be more or less happy with it, since propagating changes to the plugins shouldn't be taken lightly. |
Do you have an exit code 44 anywhere? I get it when I run |
No, I'm not seeing an error code 44 either. |
You might want to consider adding
|
@paulkorir : 👍 Will get to ASAP, but as always PRs welcome! |
Hi @paulkorir, I've started ome/omero-py#266 but it looks like |
Found the issue for 177. It's the code returned modulo 256:
See https://stackoverflow.com/questions/4448339/how-to-bypass-the-0-255-range-limit-for-sys-exit-in-python for some more information. I'll likely continue investigating this via ome/omero-py#267 |
Suggested by Damir, a few additional methods on the BaseControl
class permit discovering all errors codes for available plugins.
Example output for the state of this commit:
see: https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=8676&p=20525#p20525