#1
|
|||
|
|||
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() |
#2
|
||||
|
||||
Quote:
Calling Session.Connect() without args is equivalent to pressing the Reconnect button on the toolbar. If all you are doing is passing on the exception, why even bother with the exception type? If you just use except: without specifying an exception type, I'm thinking that you would most likely still see the pop-up. The only way to suppress Connect() related pop-up messages via scripting is to supply parameters to the Connect call sufficient to suppress pop-up messages which, in your case I'm guessing isn't how you want to use Connect() (because you likely want to leverage the fact that the tab has already been connected and you just want to have it reconnected since it's been disconnected for some time). I've added a feature request for a way via scripting to reconnect a tab without any popups so that you can handle connection errors via a script. I don't have any ETA on when/if this might ever become available, but if it does we can post here and inform you and the forum community. --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support Last edited by jdev; 09-08-2020 at 07:33 AM. |
#3
|
|||
|
|||
Thank you for hints, Jake.
Catching "Exception" does what I want. I'm satisfied with it. If it will pass for the solution, then the thread may be closed. |
#4
|
||||
|
||||
Ha! I'm glad to know that I was so wrong about the majority of my post, but my backup idea worked unexpectedly.
Thanks for trying it out and letting me know. --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#5
|
|||
|
|||
Time has passed and base exception handles it no more. I think there were specific network state (ARP state perhaps) on my PC.
Feature request for handling system exceptions or passing specific arguments for connect() is still on ![]() |
#6
|
||||
|
||||
Quote:
Out of curiosity... have you considered simply enabling the Auto reconnect option in the Terminal category of Session Options rather than attempting to reconnect disconnected tabs (silently) using a script? --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#7
|
|||
|
|||
Quote:
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|