## Major Refactoring and Error Handling Improvements

### Key Changes:
- **Code Structure**: Complete refactoring removing 392→180 lines of duplicated code
- **Error Handling**: Added comprehensive error handling with detailed tracebacks
- **Configuration**: Added configurable notification methods (email/rocket/both)
- **Security**: Fixed function naming inconsistency (send_mail→send_email)
- **Validation**: Added input validation and graceful error fallbacks

### Bug Fixes:
- Fixed version conflict in WAPT/control (removed duplicate version entry)
- Fixed syntax error in French string (unescaped apostrophe)
- Fixed missing function calls and import issues

### New Features:
- Configurable notification channels via wapt_api.ini [notifications] section
- Default configuration fallbacks when config files missing
- Network timeout handling (30s for external requests)
- SSL certificate validation with proper error messages

### Technical Improvements:
- Modular function design for better testability
- Proper exception handling for all network operations
- Better error messages with tracebacks for debugging
- Cleaner separation of concerns
This commit is contained in:
2025-12-30 15:48:34 +01:00
parent 84c736c703
commit 1f4338a85d
3 changed files with 440 additions and 129 deletions

View File

@@ -1,4 +1,9 @@
[wapt]
wapt_username = xxxxx
wapt_password = xxxxx
wapt_url =xxxxx
wapt_url =xxxxx
[notifications]
enable_email = true
enable_rocketchat = false
notification_method = both