D
Dennis Mccracken
Hi,
First let me say I'm new to ruby and RoR. I am attempting to use IPAddr
from the library in an RoR application. Two types of raise are used in
ipaddr.rb.
raise "unsupported address family"
and
raise ArgumentError, "unsupported address family"
In writing the unit tests for my module I pass badly formed IP Addresses
to make sure my model catches the errors. Depending on the error I
introduce, I need to catch the exception differently (I'm still working
out how best to handle this). My goals are to a) not have my
application terminate because of an unhandled exception and b) to
provide some guidance to the user beyond your basic "bad parameter".
Is there a convention to be observed for raising exceptions within a
module?
If there is a convention that says raise should be used consistenly
within a module, how should I pursue a remedy?
-Dennis-
First let me say I'm new to ruby and RoR. I am attempting to use IPAddr
from the library in an RoR application. Two types of raise are used in
ipaddr.rb.
raise "unsupported address family"
and
raise ArgumentError, "unsupported address family"
In writing the unit tests for my module I pass badly formed IP Addresses
to make sure my model catches the errors. Depending on the error I
introduce, I need to catch the exception differently (I'm still working
out how best to handle this). My goals are to a) not have my
application terminate because of an unhandled exception and b) to
provide some guidance to the user beyond your basic "bad parameter".
Is there a convention to be observed for raising exceptions within a
module?
If there is a convention that says raise should be used consistenly
within a module, how should I pursue a remedy?
-Dennis-