In Applescript, how do I get a line number or stack trace on error?
It's ugly but it works...

try
    set marker to 1
    -- do stuff
    set marker to 2
    -- do stuff
    set marker to 3
    1 / 0
    set marker to 4
on error errMsg number errNum
    tell application "SystemUIServer"
        display alert (marker &amp; space &amp; errMsg &amp; return &amp; return &amp; "Error number " &amp; errNum as text) buttons "Cancel" cancel button "Cancel"
    end tell
end try