3 Replies Latest reply on May 7, 2015 2:31 PM by BirajdarSupriya

    how to handle exception " Object refrence not set to an instance of an object"

    BirajdarSupriya


      Hi All,

       

      I'm testing a code written in  ACE Wizard.

      There are some calculations undergoing on the values of test input tag giving some desired output value in test output tag.

      I wanted to test , what error would come if the test input tag is deleted from the server.Expected is , I should get the ' pigetmsg -f ' log updated with message saying "input tag (or context) is deleted something like that.

       

      After deleting the test input tag two things I observed,

      1.While debugging the code error message  I'm getting is" Object refrence not set to an instance of an object" (after some searching on web, I found it as same as NullRefrenceException). I can understand that I'm getting this exception because I've deleted the test input tag.

      2.With the test input tag not being in server,the related context goes erroneous in the ACE Manager i.e. current status of context show as"error".

       

      Now, I just want to know:

      1. Is there any way to handle this exception in code, like some condition or any function of ACE to test if the input tag is absent\deleted? So, that I can update message log with below code:  

      LogPIACEMessage(mlErrors,"No input tag present for output tag:" & OutputTag.Tag, MyBase.Name)

       

      2. And If the input tag\context is accidently deleted from server, will my context in ACE Manager always go in error state and won't run the ACE scheduler at specified time? or is there any way to avoid\monitor this in ACE?

       

      The  suggestion\answers will be very much appreciated.Thanks a lot in advance.

       

      Regards,

      Supriya