Skip to content

feat: Add custom exceptions and enhanced config validation#126

Open
ZaviQ7 wants to merge 1 commit into666ghj:mainfrom
ZaviQ7:feature/custom-exceptions-and-config-validation
Open

feat: Add custom exceptions and enhanced config validation#126
ZaviQ7 wants to merge 1 commit into666ghj:mainfrom
ZaviQ7:feature/custom-exceptions-and-config-validation

Conversation

@ZaviQ7
Copy link

@ZaviQ7 ZaviQ7 commented Mar 10, 2026

Summary

This PR improves the robustness of the MiroFish backend by implementing two key architectural improvements:

1. Custom Exception Hierarchy

  • Created a MiroFishError base class with error codes, severity levels, and HTTP status codes.
  • Added domain-specific exceptions for Configuration, Graphs, Simulations, and External APIs to replace generic Exception catches.

2. Enhanced Configuration Validation

  • Implemented Config.validate_comprehensive() to check for valid URL formats, numeric ranges, and placeholder API keys.
  • Added directory permission checks and a formatted startup validation report.

Testing

  • Created unit tests in backend/tests/test_exceptions.py and backend/tests/test_config_validated.py.
  • Verified all 15+ test cases pass locally.
  • Ensured 100% backward compatibility with existing code.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant