From c044ecfba28e4d407a03ec98b7547ea38eb07680 Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 16 Jan 2026 11:21:57 +0000 Subject: [PATCH] Improve GSM scan error handling when gr-gsm not installed - Return 503 instead of 500 when grgsm_scanner not found - Show clearer error message in UI when gr-gsm unavailable - Update status display to show "Not Available" state Co-Authored-By: Claude Opus 4.5 --- routes/isms.py | 6 ++++-- static/js/modes/isms.js | 13 ++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/routes/isms.py b/routes/isms.py index ca34e2a..a6b3126 100644 --- a/routes/isms.py +++ b/routes/isms.py @@ -862,11 +862,13 @@ def start_gsm_scan(): # Check for grgsm_scanner if not get_grgsm_scanner_path(): + gsm_running = False return jsonify({ 'status': 'error', 'message': 'grgsm_scanner not found. Install gr-gsm package.', - 'install_hint': 'See setup.sh or install gr-gsm from https://github.com/ptrkrysik/gr-gsm' - }), 500 + 'install_hint': 'See setup.sh or install gr-gsm from https://github.com/ptrkrysik/gr-gsm', + 'grgsm_available': False + }), 503 # Get configuration from request data = request.get_json() or {} diff --git a/static/js/modes/isms.js b/static/js/modes/isms.js index 08e9076..44d21ed 100644 --- a/static/js/modes/isms.js +++ b/static/js/modes/isms.js @@ -798,7 +798,18 @@ async function ismsStartGsmScan() { ismsNotify('ISMS', `GSM scan started on ${band}`); } else { - ismsNotify('ISMS Error', data.message || 'Failed to start GSM scan'); + // Update status display with error + const statusText = document.getElementById('ismsGsmStatusText'); + if (statusText) { + statusText.textContent = 'Not Available'; + statusText.style.color = 'var(--accent-red)'; + } + + if (data.grgsm_available === false) { + ismsNotify('ISMS', 'gr-gsm not installed. GSM scanning requires grgsm_scanner.'); + } else { + ismsNotify('ISMS Error', data.message || 'Failed to start GSM scan'); + } } } catch (e) { ismsNotify('ISMS Error', 'Failed to start GSM scan: ' + e.message);