class Collector class ContentNotFound < Exception end class DuplicateContent < Exception end end begin raise Collector::ContentNotFound.new rescue puts "catch" end
When I run the script, I do not get a "catch" message, I see an error:
lib/collector/exception.rb:10:in `<main>': Collector::ContentNotFound (Collector::ContentNotFound)
Why? How can I catch my exceptions without typing their salvation classes?
source share