Skip to content

Commit 8c63c17

Browse files
Potential fix for code scanning alert no. 78: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6e38479 commit 8c63c17

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

server/mobile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
from Framework.Utilities import ConfigModule, CommonUtil
1616
import sys
17+
import logging
1718

1819
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'Framework', 'Built_In_Automation', 'Mobile', 'CrossPlatform', 'Appium'))
19-
2020
ADB_PATH = "adb" # Ensure ADB is in PATH
2121
UI_XML_PATH = "ui.xml"
2222
SCREENSHOT_PATH = "screen.png"
@@ -172,12 +172,13 @@ def start_ios_services():
172172
)
173173

174174
if result.returncode != 0:
175-
return {"status": "error", "error": f"Failed to launch WDA: {result.stderr}"}
175+
return {"status": "error", "error": f"Failed to launch WDA."}
176176

177177
return {"status": "ok", "port": wda_port}
178178

179179
except Exception as e:
180-
return {"status": "error", "error": str(e)}
180+
logging.exception("Failed to start iOS services")
181+
return {"status": "error", "error": "Failed to start iOS services"}
181182

182183

183184
def extract_bundle_id_from_xml(xml_content: str) -> str | None:

0 commit comments

Comments
 (0)