title: Ruby equivalent to PHPs set_error_handler
body: <p>I have just barely gotten into Ruby / ROR but need to quickly write a class for handling errors and doing something with them. I've been able to find the important examples/tutorials for the rest of what I need but I'm having trouble finding what the best alternative to PHP's "set_error_handler" is.</p>
  
  <p>My goals are:</p>
  
  <ul>
  <li>I'd like to write a class that will capture any ruby-level errors automatically.</li>
  <li>I'd like for the class to also be called by the user when there are custom errors/exceptions to report.</li>
  </ul>
  
  <p>I'd like this work for any ruby app, but my main focus is for ruby-on-rails applications as well. Thanks for your advice.</p>