Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCreate exception hierarchy #1279
Comments
woju
self-assigned this
Oct 6, 2015
woju
added this to the Release 4.0 milestone
Oct 6, 2015
woju
added
C: core
task
labels
Oct 6, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Oct 6, 2015
Member
On Tue, Oct 06, 2015 at 03:53:54AM -0700, Wojtek Porczyk wrote:
QubesException(root; has nice description to display to user)
QubesVMNotFoundError(+LookupErrororKeyError; vm cannot be found
when looking up by qid, uuid or name)QubesVMError(+AssertionError?; some problem with machine or its state;
first param is the domain in question)
QubesVMNotRunningError(not active)QubesVMNotStartedError
What is the difference?
- `QubesVMNotHaltedError` - `QubesVMNotPausedError` - `QubesVMNotSuspendedError`
QubesValueError(+ValueError; wrong value while setting property)
QubesPropertyValueError ?
QubesNotImplementedError(+NotImplementedError)BackupCancelledErrorQubesMemoryError(+MemoryError; cannot start domain)QubesNoTemplateError(template not found, like after incomplete backup)
May also cover incompatible template case (for example trying to create
HVM based on PV template). Or should it be QubesPropertyValueError?
QubesStoreError(problem withqubes.xml: not found, syntax error, etc.)
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
|
On Tue, Oct 06, 2015 at 03:53:54AM -0700, Wojtek Porczyk wrote:
What is the difference?
May also cover incompatible template case (for example trying to create
Best Regards, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Oct 6, 2015
Member
On Tue, Oct 06, 2015 at 04:18:07AM -0700, Marek Marczykowski-Górecki wrote:
- `QubesVMNotRunningError` (not active) - `QubesVMNotStartedError`What is the difference?
Paused state. For example .force_shutdown() should work when machine
is started but paused, but .run() requires machine that is running and
not paused. Both should fail when domain is powered off.
Perhaps QubesVMNotRunningError may be a child of
QubesVMNotStartedError.
- `QubesVMNotHaltedError` - `QubesVMNotPausedError` - `QubesVMNotSuspendedError`
QubesValueError(+ValueError; wrong value while setting property)
QubesPropertyValueError?
Dunno. Do we have other places, where we check values?
QubesNoTemplateError(template not found, like after incomplete backup)May also cover incompatible template case (for example trying to create
HVM based on PV template). Or should it beQubesPropertyValueError?
*ValueError. QubesNoTemplateError will be raised when attempting to
start the domain.
regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>
|
On Tue, Oct 06, 2015 at 04:18:07AM -0700, Marek Marczykowski-Górecki wrote:
Paused state. For example Perhaps
Dunno. Do we have other places, where we check values?
regards, .-. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Or even |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Oct 6, 2015
Member
On Tue, Oct 06, 2015 at 04:43:38AM -0700, Wojtek Porczyk wrote:
On Tue, Oct 06, 2015 at 04:18:07AM -0700, Marek Marczykowski-Górecki wrote:
- `QubesVMNotRunningError` (not active) - `QubesVMNotStartedError`What is the difference?
Paused state. For example
.force_shutdown()should work when machine
is started but paused, but.run()requires machine that is running and
not paused. Both should fail when domain is powered off.Perhaps
QubesVMNotRunningErrormay be a child of
QubesVMNotStartedError.
+1
- `QubesVMNotHaltedError` - `QubesVMNotPausedError` - `QubesVMNotSuspendedError`
QubesValueError(+ValueError; wrong value while setting property)
QubesPropertyValueError?Dunno. Do we have other places, where we check values?
Not sure. Maybe better keep QubesValueError and ensure appropriate
message (containing word "property").
Or even
TypeError.
QubesTypeError? Child of QubesValueError?
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
|
On Tue, Oct 06, 2015 at 04:43:38AM -0700, Wojtek Porczyk wrote:
+1
Not sure. Maybe better keep
Best Regards, |
woju commentedOct 6, 2015
There are two kinds of errors: programmer's errors and user/API errors. Current
QubesExceptionis the second kind. Programming errors should not result inraising
QubesException, but standard python exceptions and end in tool's crashand possibly log message.
Children of
QubesExceptionmay also inherit from children ofStandardError(that is, from vanilla python exceptions like
KeyError,ValueErroretc.), sowe can write readable
try/exceptstatements. In this case we should inheritfrom QubesException first.
The
AssertionErrorstandard exception is tricky, because when this error iscatched by testsuite the test result is
FAILinstead ofERROR. PerhapsQubesVMErrorcan inherit from it.Proposed hierarchy:
QubesException(root; has nice description to display to user)QubesVMNotFoundError(+LookupErrororKeyError; vm cannot be foundwhen looking up by qid, uuid or name)
QubesVMError(+AssertionError?; some problem with machine or its state;first param is the domain in question)
QubesVMNotRunningError(not active)QubesVMNotStartedErrorQubesVMNotHaltedErrorQubesVMNotPausedErrorQubesVMNotSuspendedErrorQubesValueError(+ValueError; wrong value while setting property)QubesNotImplementedError(+NotImplementedError)BackupCancelledErrorQubesMemoryError(+MemoryError; cannot start domain)QubesNoTemplateError(template not found, like after incomplete backup)QubesStoreError(problem withqubes.xml: not found, syntax error, etc.)