So this might be a dumb question but I don’t know what to ask for since ‘jruby print stack trace’ googled doesn’t come up with much thats worthwhile but,
How does one print the stack trace when writing Jruby code that accesses Java classes that throw exceptions? ie right now I took code from someone else that looks like
rescue JavaSql::SQLException
puts "SQLException"
end
which works, but I’d like to see which particular SQLException is happening like I would in Java (ie. PrintStackTrace(Exception e))? How does one accomplish this?
I’ve never worked with Java exceptions in Ruby, but AFAIK, Java exceptions get presented to you as Ruby exceptions, which means you can get the exception message by sending the
:messagemessage to the exception object:Is that what you mean? I’m not quite sure what you would need the stacktrace for in this particular situation, so I probably misunderstood.