Aias00 opened a new pull request, #994:
URL: https://github.com/apache/dubbo-go-pixiu/pull/994
## Summary
Fixes #989 Issue 3 (xDS api client init path): Replace panic with proper
error returns in `grpc_envoy.go`.
### Problem
The original implementation used panic for configuration/startup errors:
- `CreateEnvoyGrpcApiClient` would panic if cluster config was missing
- `init()` would panic if cluster retrieval or connection failed
These panics would crash the entire process instead of allowing graceful
error handling.
### Changes
- `CreateEnvoyGrpcApiClient` now returns `(*AggGrpcApiClient, error)`
- `AggGrpcApiClient.init()` now returns `error` instead of panicking
- Replace all 3 panic calls with proper error returns:
1. Missing cluster config validation → return error
2. Failed to get gRPC cluster → return wrapped error
3. Failed to get connection → return wrapped error
- Update caller in `xds.go` to handle the new error return
### Classification
All 3 panics were **configuration/startup errors**, not true invariant
violations:
- Configuration mistakes or transient dependency failures should not
terminate the process
- Error propagation allows graceful handling and better diagnostics
## Test Plan
- Build passes: `go build ./pkg/config/xds/...`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]