No description
Find a file
Stephan Lo 2625a58691 feat: implement unified domain error handling system
Addresses Verbesserungspotential 2 (Error Handling uneinheitlich) by introducing
a comprehensive, structured error handling approach across all architectural layers.

## New Domain Error System
- Add ErrorCode enum with 15 semantic error types (NOT_FOUND, VALIDATION_FAILED, etc.)
- Implement DomainError struct with operation context, resource identifiers, and regions
- Create resource-specific error constructors (NewAppError, NewInstanceError, NewCloudletError)
- Add utility functions for error type checking (IsNotFoundError, IsValidationError, etc.)

## Service Layer Enhancements
- Replace generic fmt.Errorf with structured domain errors in all services
- Add comprehensive validation functions for App, AppInstance, and Cloudlet entities
- Implement business logic validation with meaningful error context
- Ensure consistent error semantics across app_service, instance_service, cloudlet_service

## Adapter Layer Updates
- Update EdgeConnect adapters to use domain errors instead of error constants
- Enhance CLI adapter with domain-specific error checking for better UX
- Fix SDK examples to use new IsNotFoundError() approach
- Maintain backward compatibility where possible

## Test Coverage
- Add comprehensive error_test.go with 100% coverage of new error system
- Update existing adapter tests to validate domain error types
- All tests passing with proper error type assertions

## Benefits
-  Consistent error handling across all architectural layers
-  Rich error context with operation, resource, and region information
-  Type-safe error checking with semantic error codes
-  Better user experience with domain-specific error messages
-  Maintainable centralized error definitions
-  Full hexagonal architecture compliance

Files modified: 12 files updated, 2 new files added
Tests: All passing (29+ test cases with enhanced error validation)
2025-10-08 16:52:36 +02:00
.claude feat(apply): Implement EdgeConnect configuration parsing foundation 2025-09-29 16:18:35 +02:00
.github/workflows ci: Added test workflow running on each push except tags 2025-10-07 16:10:02 +02:00
api feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
internal feat: implement unified domain error handling system 2025-10-08 16:52:36 +02:00
sdk feat: implement unified domain error handling system 2025-10-08 16:52:36 +02:00
.envrc.example chore: Added flake 2025-10-07 14:37:54 +02:00
.gitignore chore: Added flake 2025-10-07 14:37:54 +02:00
.goreleaser.yaml fix(cli): Force usage of gitea token 2025-10-02 13:44:28 +02:00
apply-todo.md feat(apply): Implement CLI command with comprehensive deployment workflow 2025-09-29 17:24:59 +02:00
apply.md chore(cli): Removed appName from config schema. This is redundant to metadata name 2025-09-30 11:33:52 +02:00
config.yaml.example feat(cli): Implement Edge Connect CLI tool 2025-09-18 13:51:09 +02:00
devbox.json chore(): unique go version 1.25, fixes 'make test-coverage' error 2025-10-08 16:49:31 +02:00
devbox.lock chore(): unique go version 1.25, fixes 'make test-coverage' error 2025-10-08 16:49:31 +02:00
Dockerfile feat(client): add basic client, model 2025-09-16 13:02:33 +02:00
flake.lock chore: Added flake 2025-10-07 14:37:54 +02:00
flake.nix chore(): unique go version 1.25, fixes 'make test-coverage' error 2025-10-08 16:49:31 +02:00
go.mod feat(apply): Implement deployment planning with intelligent state comparison 2025-09-29 16:36:21 +02:00
go.sum feat(apply): Implement deployment planning with intelligent state comparison 2025-09-29 16:36:21 +02:00
hexagonal-architecture-proposal.md feat(arch) added hexagonal arch impl done with ai 2025-10-08 12:55:53 +02:00
main.go feat(arch) added hexagonal arch impl done with ai 2025-10-08 12:55:53 +02:00
Makefile chore(): unique go version 1.25, fixes 'make test-coverage' error 2025-10-08 16:49:31 +02:00
plan.md feat(apply): Implement EdgeConnect configuration parsing foundation 2025-09-29 16:18:35 +02:00