Skip to content
Snippets Groups Projects
Commit eb463ded authored by Daniele Nicolodi's avatar Daniele Nicolodi
Browse files

sap: Correctly report timeout errors

Specialized exceptions make understanding why opening a new SAP
session fails much easier, in particular when it happens because of
inactivity auto logout.
parent 1c568514
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@ class Connection():
time.sleep(0.1)
if len(application.Connections) > 0:
break
else:
raise TimeoutError
if len(application.Connections) != 1:
raise ConnectionError
......@@ -59,6 +61,8 @@ class Connection():
time.sleep(0.1)
if len(self.connection.Sessions) > len(sessions):
break
else:
raise TimeoutError
session = self.connection.Sessions(len(sessions))
return Session(session, debug)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment