4 Replies Latest reply on Feb 20, 2007 6:51 PM by Newsgroup_User

    debugging with alertHook

    Level 7
      I'm debugging in runtime mode with alertHook. I know how to display the
      text of the error and the message in a debug window. But is there a way to
      get more information such as the script and line number the error was
      generated from? I'm setting up some test sites so I want to get as much
      detail back from my testers as possible. I realize I can use numerous "put"
      statements, but I'm trying to avoid this.

      Thanks,

      Brian


        • 1. Re: debugging with alertHook
          Level 7
          Unfortunately there is no runtime access to line number info - it would
          be a fabulous addition!
          You could set global/s that will tell you script name and handler name
          and access them from your alertHook script, but AFAIK that's about as
          good as it will get.
          • 2. Re: debugging with alertHook
            Level 7
            Thanks for the reply, but how would I set globals to get the script and
            handler names? Would I do this inside of the alertHook handler or would I
            have to pass it some parameters?

            -- Brian

            "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
            news:erfq8e$1rh$1@forums.macromedia.com...
            > Unfortunately there is no runtime access to line number info - it would be
            > a fabulous addition!
            > You could set global/s that will tell you script name and handler name and
            > access them from your alertHook script, but AFAIK that's about as good as
            > it will get.


            • 3. Re: debugging with alertHook
              Level 7
              Something like the following - although it requires modifying *all* your
              handlers:

              -- button script
              global gScriptDetails

              on mouseUp me
              gScriptDetails[#scriptName] = "button script"
              gScriptDetails[#handlerName] = #mouseUp
              -- ...
              end

              -- alertHook script
              global gScriptDetails

              on alertHook(me, anErrorType, aMessage, aGenerator)
              tScript = gScriptDetails[#scriptName]
              tHandler = gScriptDetails[#handlerName]
              -- whatever processing and logging
              end
              • 4. Re: debugging with alertHook
                Level 7
                Yes, I figured something like that. I was hoping for something simple.

                Brian

                "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
                news:erg9rf$ij7$1@forums.macromedia.com...
                > Something like the following - although it requires modifying *all* your
                > handlers:
                >
                > -- button script
                > global gScriptDetails
                >
                > on mouseUp me
                > gScriptDetails[#scriptName] = "button script"
                > gScriptDetails[#handlerName] = #mouseUp
                > -- ...
                > end
                >
                > -- alertHook script
                > global gScriptDetails
                >
                > on alertHook(me, anErrorType, aMessage, aGenerator)
                > tScript = gScriptDetails[#scriptName]
                > tHandler = gScriptDetails[#handlerName]
                > -- whatever processing and logging
                > end