Re: Overriding Kernel#raise
- From: Shane Liesegang <shane@xxxxxxxxxx>
- Date: Sat, 1 Sep 2007 03:03:37 +0900
Whoops. Duh. :-)
Early on in the code I hadn't been using *a and forgot to excise those
remnants. Thanks for pointing it out.
Jason Roelofs wrote:
The splat operator is your friend:
module Kernel
alias _raise raise
def raise(*a)
begin
_raise(*a)
rescue Exception => e
$stderr.print e.class, ": ", e.message, "\n"
$stderr.puts e.backtrace unless e.backtrace.nil?
end
end
end
As I've never done this or seen it done, I'm not sure how well it will
work, but for your needs this looks fine.
Jason
--
Posted via http://www.ruby-forum.com/.
.
- References:
- Overriding Kernel#raise
- From: Shane Liesegang
- Overriding Kernel#raise
- Prev by Date: Re: ENV['LD_LIBRARY_PATH'] not changing env
- Next by Date: Re: python-style decorators
- Previous by thread: Overriding Kernel#raise
- Next by thread: rsync functionality in Ruby?
- Index(es):