-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
Description
Standardize error handling across all contracts with detailed error codes and messages. Currently, error handling is inconsistent between contracts and lacks descriptive error information.
Files to Modify
contracts/manage_hub/src/errors.rs- Expand error definitionscontracts/access_control/src/errors.rs- Add missing error casescontracts/membership_token/src/lib.rs- Update error handlingcontracts/common_types/src/lib.rs- Add unified error typescontracts/manage_hub/src/lib.rs- Update all function signaturescontracts/manage_hub/src/subscription.rs- Replace panic! callscontracts/manage_hub/src/attendance_log.rs- Add validation errors
Key Changes Required
- Unified Error System - Create a comprehensive error enum in
common_types/src/lib.rsthat covers all contract operations - Error Handling Updates - Replace all
unwrap(),expect(), andpanic!calls throughout the codebase with properResultreturns - Error Context - Add descriptive error messages and error categorization (recoverable vs critical errors)
- Function Signature Updates - All public functions in
lib.rsneed to returnResult<T, Error>instead of panicking - Cross-Contract Error Mapping - Implement proper error conversion between different contract modules
- Error Recovery - Add mechanisms to handle and recover from non-critical errors where possible
Acceptance Criteria
- Create unified error enum in common_types
- Replace all panic! calls with proper error returns
- Add descriptive error messages for each error code
- Implement error recovery mechanisms where appropriate
- Update all contract methods to use Result types
- Add comprehensive error handling tests
- Add error logging and monitoring capabilities
- Document error codes for frontend integration
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program