Commit 0993b6f
committed
feat: Enhanced exception handling, automatic initialization, and dynamic locale detection
Major improvements to developer experience and Lambda function simplification:
## Enhanced Exception Handling
- Enhanced handle_exceptions function with optional custom error messages
- Support for both message keys and direct strings in error handling
- Automatic localization fallback when message keys are not found
- Comprehensive unit tests for exception handling scenarios
## Automatic Message Manager Initialization
- Added auto_initialize_messages configuration option to Config class
- Automatic MessageManager initialization with locale from Lex request
- Eliminates need for manual initialize_message_manager() calls
- Graceful error handling for MessageManager initialization failures
## Automatic Exception Handling in Lambda Functions
- Added auto_handle_exceptions configuration option to Config class
- Automatic exception handling and error response generation
- Custom error message configuration via error_message parameter
- Eliminates need for try/catch blocks in Lambda functions
- Reduces Lambda function boilerplate by ~50%
## Message Consistency Testing Framework
- Comprehensive test suite for message key consistency across locales
- Validates all YAML message files have identical keys
- Parameter consistency validation for message templates
- Placeholder detection to prevent incomplete translations
- Required message category validation
## Dynamic Locale Detection in CDK
- Automatic locale detection based on Lex bot export structure
- Dynamic generation of bot locale configurations
- Eliminates hardcoded locale lists in CDK stack
- Reads confidence thresholds from BotLocale.json files
## Enhanced Deployment Scripts
- Improved deployment script with better error handling
- Automatic cleanup of old wheel files to prevent hash conflicts
- Targeted uv cache cleaning for specific packages
- Lock file regeneration to avoid dependency conflicts
## Developer Experience Improvements
- Simplified Lambda function structure with automatic handling
- Enhanced Config class with new configuration options
- Maintains backward compatibility with existing configurations
- Comprehensive test coverage for all new features1 parent 21ffe36 commit 0993b6f
15 files changed
Lines changed: 1493 additions & 155 deletions
File tree
- examples/sample_airline_bot
- integration_tests
- lambdas/fulfillment_function
- src/fulfillment_function
- intents
- lib
- scripts
- lex_helper
- core
- exceptions
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
10 | 53 | | |
11 | 54 | | |
12 | 55 | | |
| |||
16 | 59 | | |
17 | 60 | | |
18 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
19 | 86 | | |
20 | 87 | | |
21 | 88 | | |
22 | 89 | | |
23 | 90 | | |
24 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
25 | 95 | | |
26 | 96 | | |
27 | 97 | | |
| |||
0 commit comments