new ruby error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)


Attachment: smime.p7s
Description: S/MIME cryptographic signature

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]