One line Tropo debugging gem

I’ve worked with Tropo, a cloud telephony platform, for a few months now, primarily using the Ruby scripting API. Tropo’s script execution model is a bit strange–the script file is pre-pended with a bootstrap block of code and the combined stream is executed inside a JVM (so it’s JRuby, really). Stack traces in logs report line numbers from that composite file, which don’t map to line numbers in the the source script–they are offset by the bootstrap code block’s length. My most useful Tropo scripting debugging aid is the first line of my Tropo scripts:

$currentCall.log "---- Tropo first line offset is #{__LINE__}"

This is how I know to subtract 215 from the line numbers to map to my code.

About Simeon Simeonov

Entrepreneur. Investor. Trusted advisor.
This entry was posted in Code and tagged , . Bookmark the permalink.

1 Response to One line Tropo debugging gem

  1. Pingback: better bash debugging | Linux and Photography Blog

Leave a Reply