Improve error handling: log silently swallowed exceptions - #2
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces ~15 bare
except Exception: passblocks acrossMeshCore_Dynamic_Interface.pyandMeshCore_Interface.pywith properRNS.log()/_safe_log()calls so failures are visible in logs instead of silently swallowed.MeshCore_Dynamic_Interface.py — 7 fixes:
_async_setup→set_radiofailure now logged atLOG_WARNING(was silentpass)_bind_discovery_loop→ RNSBIND_REQ, heartbeat, and response send failures all logged atLOG_WARNING(were 3 separate silentpassblocks)_process_tunnel_text→ base64 decode errors logged atLOG_DEBUG(was silentreturn)_process_tunnel_text→ reassemblyexcept Exceptionnow logs pkt_id + sender context atLOG_WARNING(was silent cleanup + return)processOutgoing→ fragment enqueue failure logged atLOG_WARNING(was silentpass— data loss with no indication)MeshCore_Interface.py — 8 fixes:
_read_reticulum_config_file→ file read errors logged atLOG_WARNING(was silentcontinue)_open_serial_and_init→ initialget_contacts()failure logged atLOG_WARNING(was silentpass)_open_serial_and_init→ removed redundant outertry/except: passwrapping transport registration (inner handler already logged)_open_serial_and_init→fut.result(timeout=5)timeout now logged atLOG_DEBUGwith context (was silentpass)_handle_incoming_payload→ sender key normalization fallback logged atLOG_DEBUG(was silent)_handle_incoming_payload→ peer mapping update failures logged atLOG_DEBUG(was silentpass)_handle_new_contact_event→ endpoint_contact resolution and outer handler both logged atLOG_WARNING(were nested silentpassblocks)process_outgoing→ destination extraction failure logged atLOG_DEBUG(was silentpass)Log levels follow the existing conventions:
LOG_WARNINGfor failures that affect functionality (lost packets, failed sends, failed config reads),LOG_DEBUGfor lower-severity fallbacks (normalization, mapping updates, decode errors on potentially-not-for-us data).MeshCore_Channel_Interface.pyalready had proper error logging throughout — no changes needed.Link to Devin session: https://app.devin.ai/sessions/62c34020c20345cb830c0a8bd48ed9f7
Requested by: @comms-engineer