Forum Discussion

shankar_r's avatar
shankar_r
Community Hero
8 years ago

TypeError: Log.Error is not a function

Today i got a weird error message as TypeError: Log.Error is not a function when execution running.

 

Have anyone got this kind of error. My function looks like below

 

function test()
{
      try
      {
        //doing mycoding
      }
      catch (ex)
      {
            Log.Error("Error occurred " + ex.stack)
      }
}

Scripting Language : JavaScript

16 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    That is weird.  Logging is a built in capability of TC so having it generate that kind of error is... weird.

    So... question, that error you got, is it happening on the Log.Error in the catch or is it happening up within your main function code?  It would be interesting to step through and see where you're actually getting the error... it's almost like something has gone out of context somewhere where the Log object is no longer recognized.

    • shankar_r's avatar
      shankar_r
      Community Hero

      I'm doing some scripting AUT methods like getModel(), getNodeArray() [this is some customized functions in AUT]. I got an exception inside try and then TC tried to log the error in catch block.  Then this weird thing happend.

       

       

      And also this is not happening always, Last few days i'm getting this error.

      • shankar_r's avatar
        shankar_r
        Community Hero

        Actual error message which i got.

         

        Error occured in driver script and Error Description: TypeError: Log.Error is not a function
            at fn_executemodules (<aq:Driver>:304:29)
            at driverscript (<aq:Driver>:168:31)    18:43:48    Normal