[Libvir] new ruby error handling
Vadim Zaliva
lord at crocodile.org
Fri Apr 11 06:28:12 UTC 2008
I have a dumb question about new error handling. What is the rationale
for using
'libvirt_message' instead of 'message' in new Libvirt Ruby error
classes?
Here is an example of code I am writing:
rescue SystemCallError
process($!.message)
...
rescue Libvirt::Error
process($!.libvirt_message)
...
instead of, shorter:
rescue Libvirt::Error, SystemCallError
process($!.message)
...
In reality, my rescue classes are bit longer, so the code gets hairy.
Wouldn't it be better to use standard 'message' attribute instead?
Sincerely,
Vadim
--
"La perfection est atteinte non quand il ne reste rien a ajouter, mais
quand il ne reste rien a enlever." (Antoine de Saint-Exupery)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1607 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080410/7c02ec49/attachment-0001.p7s>
More information about the libvir-list
mailing list