Revision 9f9c8ee2 lib/errors.py
b/lib/errors.py | ||
---|---|---|
224 | 224 |
|
225 | 225 |
This is not necessarily an error (and thus not a subclass of GenericError), |
226 | 226 |
but it's an exceptional circumstance and it is thus treated. This instance |
227 |
should be instantiated with a tuple of two values. The first value will
|
|
228 |
specify whether an error should returned to the caller, and the second one
|
|
229 |
will be the returned result (either as an error or as a normal result).
|
|
227 |
should be instantiated with two values. The first one will specify whether an
|
|
228 |
error should returned to the caller, and the second one will be the returned
|
|
229 |
result (either as an error or as a normal result). |
|
230 | 230 |
|
231 | 231 |
Examples: |
232 | 232 |
# Return a result of "True" to the caller, but quit ganeti afterwards |
233 |
raise QuitGanetiException((False, True))
|
|
233 |
raise QuitGanetiException(False, True)
|
|
234 | 234 |
# Send an error to the caller, and quit ganeti |
235 |
raise QuitGanetiException((True, "Fatal safety violation, shutting down"))
|
|
235 |
raise QuitGanetiException(True, "Fatal safety violation, shutting down")
|
|
236 | 236 |
|
237 | 237 |
""" |
238 | 238 |
|
Also available in: Unified diff