I understand the concept of rescue- My question is this:
Should I write my begin rescue end
code within my class or should I write it outside the class when I'm actually creating an object? If I have two files - one with my class, one where I call that class, which script do I put my rescue script in? Perhaps it doesn't matter, or maybe I should use both. Just wondering what best practices are for this...
The general rule with exception handling is to catch the exception at the lowest abstraction level where its possible to make an intelligent choice on how to handle the error.
If you can make an intelligent choice inside the class method, include your rescue logic there. If you will have more context at the caller level and you want custom logic each time the method is called, then put the rescue logic outside the class.