Devr.AI icon indicating copy to clipboard operation
Devr.AI copied to clipboard

BUG: Silent Exceptions in Backend Initialization Are Not Logged

Open itzsudipta opened this issue 10 months ago • 3 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

What happened?

📌 Issue Overview

There are several places in the backend where exceptions are being "swallowed" (ignored) by using except Exception: pass. This pattern is used, for example, when setting up database indices or initializing service components. When an error occurs within these try blocks, no message is printed or logged, and the backend continues running as if nothing is wrong—even though some features may break or behave unpredictably.

Location:
Most notably found in files under:

  • backend/app/database/falkor/code-graph-backend/api/graph.py

🔍 Steps to Reproduce

  1. Open the Python file in backend/app/database/falkor/code-graph-backend/ api/graph.py
  2. Search for except Exception: pass
  3. Trigger or simulate an error inside one of these try blocks (e.g., fail a database/index creation)
  4. Check the logs — notice that no error is recorded and the application continues running silently

🎯 Expected Behavior

All exceptions during initialization and setup should be logged using Python’s logging module with descriptive messages and context

🚨 Actual Behavior

Exceptions raised during backend initialization or setup are silently ignored due to except Exception: pass.
No logs or error messages are generated, allowing failures to go unnoticed.

📷 Screenshot

💡 Suggested Improvements

try: self.g.create_node_range_index("File", "name", "ext") except Exception as exc: logging.error(f"Failed to create node range index: {exc}")

Record

  • [x] I agree to follow this project's Code of Conduct
  • [x] I want to work on this issue

itzsudipta avatar Jan 30 '26 14:01 itzsudipta

@itzsudipta please review #263

dolliecoder avatar Feb 03 '26 09:02 dolliecoder

@dolliecoder Hey! I noticed you created another PR for this as well. I’ve also submitted a version that refactors the index initialization and specifically addresses the ResponseError handling. No worries at all—I'll leave it to the maintainers to decide which approach fits the project better.☺️

itzsudipta avatar Feb 03 '26 17:02 itzsudipta

@dolliecoder Hey! I noticed you created another PR for this as well. I’ve also submitted a version that refactors the index initialization and specifically addresses the ResponseError handling. No worries at all—I'll leave it to the maintainers to decide which approach fits the project better.☺️

sure !

dolliecoder avatar Feb 03 '26 18:02 dolliecoder