Forum Discussion

Varunawasthi's avatar
Varunawasthi
Occasional Contributor
7 years ago

trycatch stopped working for The Object does not exist

Hi Team,

 

The try catch was working 2 weeks back and now all of a sudden its stopped .

 

Snippet

 

try{

progressbar = progressbarload()

sys.highlightobject(progressbar )

}

catch(e){}

 

 

while running its while loop so at last instance the object is not identified and I want to ignore it as then logs will be more cleaner but its not working for " The object doesn't t exist"

 

 

can you please help is there some settings to be done so that when Script log is generated I don't see the above error it be ignored.

 

or do something that try/catch starts working?

 

  • shankar_r's avatar
    shankar_r
    Community Hero

    Basically, Try Catch will catch the Object doesn't exists error.

     

    If you want to ignore the Object doesn't exists error then you have to the check the object existent before you do your validation. like below.

     

    try{
    
    progressbar = progressbarload() // I'm not sure what it will return but below is the generic way to ignore the object not exists error
    
    if( progressbar != null && progressbar.Exists){
       sys.highlightobject(progressbar )
       }
    }
    
    catch(e){}