Skip to content

Improve error handling: log silently swallowed exceptions - #2

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1783038581-improve-error-handling
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1783038581-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Replaces ~15 bare except Exception: pass blocks across MeshCore_Dynamic_Interface.py and MeshCore_Interface.py with proper RNS.log() / _safe_log() calls so failures are visible in logs instead of silently swallowed.

MeshCore_Dynamic_Interface.py — 7 fixes:

  • _async_setupset_radio failure now logged at LOG_WARNING (was silent pass)
  • _bind_discovery_loop → RNSBIND_REQ, heartbeat, and response send failures all logged at LOG_WARNING (were 3 separate silent pass blocks)
  • _process_tunnel_text → base64 decode errors logged at LOG_DEBUG (was silent return)
  • _process_tunnel_text → reassembly except Exception now logs pkt_id + sender context at LOG_WARNING (was silent cleanup + return)
  • processOutgoing → fragment enqueue failure logged at LOG_WARNING (was silent pass — data loss with no indication)

MeshCore_Interface.py — 8 fixes:

  • _read_reticulum_config_file → file read errors logged at LOG_WARNING (was silent continue)
  • _open_serial_and_init → initial get_contacts() failure logged at LOG_WARNING (was silent pass)
  • _open_serial_and_init → removed redundant outer try/except: pass wrapping transport registration (inner handler already logged)
  • _open_serial_and_initfut.result(timeout=5) timeout now logged at LOG_DEBUG with context (was silent pass)
  • _handle_incoming_payload → sender key normalization fallback logged at LOG_DEBUG (was silent)
  • _handle_incoming_payload → peer mapping update failures logged at LOG_DEBUG (was silent pass)
  • _handle_new_contact_event → endpoint_contact resolution and outer handler both logged at LOG_WARNING (were nested silent pass blocks)
  • process_outgoing → destination extraction failure logged at LOG_DEBUG (was silent pass)

Log levels follow the existing conventions: LOG_WARNING for failures that affect functionality (lost packets, failed sends, failed config reads), LOG_DEBUG for lower-severity fallbacks (normalization, mapping updates, decode errors on potentially-not-for-us data).

MeshCore_Channel_Interface.py already had proper error logging throughout — no changes needed.

Link to Devin session: https://app.devin.ai/sessions/62c34020c20345cb830c0a8bd48ed9f7
Requested by: @comms-engineer

Replace bare 'except Exception: pass' blocks with proper logging
across MeshCore_Dynamic_Interface.py and MeshCore_Interface.py.

MeshCore_Dynamic_Interface.py:
- Log radio config failures (set_radio)
- Log RNSBIND_REQ, heartbeat, and response send failures
- Log base64 decode errors in debug mode
- Log reassembly failures with pkt_id and sender context
- Log fragment enqueue failures in processOutgoing

MeshCore_Interface.py:
- Log config file read errors
- Log initial contact fetch failures
- Remove redundant nested try/except in transport registration
- Log async setup timeout context instead of silently passing
- Log sender key normalization fallbacks at debug level
- Log peer mapping update failures at debug level
- Log endpoint_contact resolution failures
- Log destination extraction failures at debug level

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@comms-engineer comms-engineer self-assigned this Jul 3, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant