Aias00 opened a new pull request, #996:
URL: https://github.com/apache/dubbo-go-pixiu/pull/996

   ## Summary
   
   Fixes #989 Issue 3 (network filter/plugin construction path): Replace panic 
with proper error returns in dubboproxy filter construction.
   
   ### Problem
   
   The original implementation used panic for type assertion failures:
   - `plugin.go`: panic when config type assertion fails
   - `manager.go`: panic when data type assertion fails
   
   Both methods already had error return values in their signatures but were 
panicking instead.
   
   ### Changes in plugin.go
   - `CreateFilter`: Replace panic with error return when config type assertion 
fails
   - Now returns proper error: "expected 
*model.DubboProxyConnectionManagerConfig, got %T"
   
   ### Changes in manager.go
   - `OnData`: Replace panic with error return when data type assertion fails
   - Now returns proper error: "expected *invocation.RPCInvocation, got %T"
   
   ### Classification
   
   Both panics were **type assertion failures** during request/startup handling:
   - Neither was a true invariant violation
   - Both methods already had error returns - just not using them
   - Returning errors allows graceful handling without crashing the server
   
   ### Note
   
   The `recover()` in `handleRpcInvocation` (line 182-187) is kept as is - 
that's a proper defensive pattern that catches panics from filter chain 
execution.
   
   ## Test Plan
   
   - Build passes: `go build ./pkg/filter/network/dubboproxy/...`
   
   🤖 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]

Reply via email to