Skip to content

Commit 1f36503

Browse files
authored
Merge pull request #247 from AutomationSolutionz/save_database_error_inside_variable
This particular fix will catch database error and save them inside va…
2 parents c0564c0 + db99497 commit 1f36503

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Framework/Built_In_Automation/Database/BuiltInFunctions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,10 @@ def db_select(data_set):
338338
"""
339339

340340
sModuleInfo = inspect.currentframe().f_code.co_name + " : " + MODULE_NAME
341-
342341
try:
343-
variable_name = None
344342
query = None
345343
session_name = 'default'
346-
344+
variable_name = None
347345
for left, mid, right in data_set:
348346
if left == "query":
349347
# Get the and query, and remove any whitespaces
@@ -371,6 +369,7 @@ def db_select(data_set):
371369

372370
# Fetch all rows and convert into list
373371
db_rows = []
372+
374373
while True:
375374
db_row = db_cursor.fetchone()
376375
if not db_row:
@@ -389,7 +388,9 @@ def db_select(data_set):
389388
)
390389
return "passed"
391390
except Exception as e:
391+
sr.Set_Shared_Variables(variable_name, e)
392392
return handle_db_exception(sModuleInfo, e)
393+
#change
393394

394395

395396
@logger

0 commit comments

Comments
 (0)