Skip to content

Conversation

ozkanuysal
Copy link

Enhanced Error Handling and Logging System

This PR introduces a comprehensive error handling and logging system to the Kappe codebase, making it more robust and developer-friendly. The changes adhere to Pythonic principles, focusing on explicit error handling, informative error messages, and structured logging.

Key Improvements:

  • Hierarchical Exception Classes: Created a custom exception hierarchy with KappeError as the base class, and specialized exceptions for different error types (file operations, configuration, plugins, etc.)
  • Advanced Logging Utilities: Implemented a unified logging system with support for different log levels, formats, and output destinations, including log rotation capabilities
  • Error Handling Decorators: Added @handle_errors decorator for consistent error handling across the application
  • Global Exception Capture: Implemented a global exception handler to ensure all uncaught exceptions are properly logged
  • Enhanced CLI Experience: Improved error reporting with context-aware error messages and appropriate exit codes
  • Better Debugging Support: Added detailed error context and traceback information to help diagnose issues faster

These changes make the codebase more maintainable and resilient, while providing users with better feedback when errors occur. All changes follow Python best practices and maintain backward compatibility.

Next Steps -> Work in progress

  • Add test cases
  • Separate basemodel classes and logic for each script.

@mrkbac
Copy link
Contributor

mrkbac commented Jul 23, 2025

Thanks a lot for the PR! We're currently busy restructuring the code and adding a bunch of tests. We'll be sure to get back to this PR soon!

@ozkanuysal
Copy link
Author

Thanks a lot for the PR! We're currently busy restructuring the code and adding a bunch of tests. We'll be sure to get back to this PR soon!

Thanks, Marko! I'm eager to contribute to the project; it seems like a great one. Based on your feedback, I can update the pull request and would be happy to help with other tasks as well.

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.

2 participants