View Single Post
  #1  
Old 09-03-2020, 12:30 AM
kva kva is offline
Registered User
 
Join Date: Jul 2020
Posts: 11
Exception for "The specified network name is no longer available"

The common part of my script is
Code:
def connect():
    global nr
    for i in range(60):
        if not tab.Session.Connected:
            try:
                tab.Session.Connect()
                nr = tab.Screen.WaitForStrings('#', 20)
                break
            except ScriptError:
                pass
        else:
            nr = True
            break
    else:
        return False
    return nr

def main():
    global nr
    sending, waitingforstring, etc

tab = crt.GetScriptTab()
tab.Screen.Synchronous = True
tab.Screen.IgnoreEscape = True

if connect():
    main()
Sometimes when script tries to connect to unavailable device, the pop-up window tells me: "The specified network name is no longer available". ScriptError does not handle this error? Which exception should?
Reply With Quote