pretty exceptions

A

Ara.T.Howard

hopefully i'm not missing anything obvious here, but doesn't i make sense that
there should be something that allows one to display an Exception in the way
ruby does it (when raised) with class, message, and backtrace, something like:

class Exception
def errmsg
"%s: %s\n%s" % [self.class, message, (backtrace || []).join("\n") << "\n"]
end
end

wouldn't it make sense for Exception#inspect to do this?

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL :: http://www.ngdc.noaa.gov/stp/
| TRY :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done
===============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

narray on windows? 1
Class::name 0
idiot's guide to druby using ssh tunnels 4
drb with udp 1
parent of TrueClass, FalseClass 9
pthread 2
Object#copy [rcr?] 4
pthread masters (that's you guy) 1

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top