From d924419d28d7e751a2105d971945cc0767ec0847 Mon Sep 17 00:00:00 2001 From: James Smith Date: Sun, 21 Dec 2025 17:00:35 +0000 Subject: [PATCH] Improve WiFi error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Strip ANSI escape codes from airodump-ng error output - Add helpful message for 'Failed initialising' errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- intercept.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/intercept.py b/intercept.py index 08a2208..56faa2d 100755 --- a/intercept.py +++ b/intercept.py @@ -5163,6 +5163,10 @@ def start_wifi_scan(): error_msg = stderr_output or stdout_output or f'Process exited with code {exit_code}' + # Strip ANSI escape codes + import re + error_msg = re.sub(r'\x1b\[[0-9;]*m', '', error_msg) + # Common error explanations if 'No such device' in error_msg or 'No such interface' in error_msg: error_msg = f'Interface "{interface}" not found. Make sure monitor mode is enabled.' @@ -5170,6 +5174,8 @@ def start_wifi_scan(): error_msg = 'Permission denied. Try running with sudo.' elif 'monitor mode' in error_msg.lower(): error_msg = f'Interface "{interface}" is not in monitor mode. Enable monitor mode first.' + elif 'Failed initialising' in error_msg: + error_msg = f'Failed to initialize "{interface}". The adapter may have been disconnected or monitor mode is not active. Try disabling and re-enabling monitor mode.' return jsonify({'status': 'error', 'message': error_msg})