Are you looking for something like this?  If not, please let me know what your looking for.

<pre>
    begin
      query = res.send(domain)
    rescue => e
      print_error("Issues with #{domain} - #{e}")
      return
    end
</pre>