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

[Libvir] new ruby error handling



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


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