import json, subprocess
r = subprocess.run(['uv', 'run', 'python', 'scripts/audit_exception_handling.py', '--src', 'src', '--json'], capture_output=True, text=True)
data = json.loads(r.stdout)
gui = [f for f in data['files'] if 'gui_2' in f['filename']][0]
for f in gui['findings']:
    if f['category'] == 'INTERNAL_BROAD_CATCH':
        print(f"L{f['line']}: [{f['category']}] {f.get('context', '')}")
print()
for f in gui['findings']:
    if f['category'] == 'INTERNAL_SILENT_SWALLOW':
        print(f"L{f['line']}: [{f['category']}] {f.get('context', '')}")
