• LogEvent in Terminate looks like it came from elsewhere

    By John Smart 1 decade ago

    Very low priority….



    I kept track of the number of errors that occurred in my agent, and then put



    Call LogEvent("Agent terminating with " & iErrors & " errors.", SEVERITY_LOW, Nothing)



    in the Terminate script. When I did this, the resulting log entry either looked like it came from a view action or bookmarks.nsf. I doubt this is an actual bug in your code… it makes sense because session.CurrentAgent returns nothing from the Terminate… but you might want to document it somewhere to not call your script library from the Terminate script so that dummies like me have no excuse for getting confused.*






    • 'course, that rarely stops me :-/
    • Ah... I'll have to look into that

      By Julian Robichaux 1 decade ago

      Oops, I never tested from the Terminate event before!

      :-)



      I didn't realize that CurrentAgent would be null at that point, but it makes sense. I'll need to think about how I handle that. Maybe I could try to grab the agent name in the Initialize section of the script library or something. Hmm. I'll have to think about it…



      Thanks!


      • Julian
      • Nah, just note it somewhere, IMO

        By John Smart 1 decade ago

        I wouldn't mess with it, I'd just note it somewhere (maybe in a "known issues" section?) and move on, if I were you.



        Or just leave it alone since it's now here on OpenNTF. It's really not a big deal, I just moved it between my ExitSub label and my Exit Sub statement in my Initialize and, as long as the agent doesn't crash hard, it's all good.