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

I'm an entrepreneur, hacker, angel investor and reformed VC. I am currently Founder & CTO of Swoop, a health AI platform. Through FastIgnite I invest in and work with a few great startups to get more done with less. Learn more, follow @simeons on Twitter and connect with me on LinkedIn.
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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s