raise one on your own with the raise method from Kernel : raise « Statement « Ruby






raise one on your own with the raise method from Kernel



bad_dog = true

if bad_dog
  raise StandardError, "bad doggy"
else
  arf_arf
end

 








Related examples in the same category

1.Raising Exceptions
2.Raise exception from constructor
3.raise ArgumentError
4.Raise IndexError