Bug Description
In rpc/backend/backend.go, NewBackend() uses panic() for two failure conditions:
appConf, err := config.GetConfig(ctx.Viper)
if err != nil {
panic(err) // Line ~210
}
rpcClient, ok := clientCtx.Client.(tmrpcclient.SignClient)
if !ok {
panic(fmt.Sprintf("invalid rpc client...")) // Line ~215
}
Impact
- Any operator misconfiguration in
app.toml causes an unrecoverable crash with an unhelpful panic trace
- A wrong client type produces a panic instead of a descriptive error
- All 5 callers in
rpc/apis.go have no way to handle these failures gracefully
Proposed Fix
Change NewBackend signature to return (*Backend, error) and replace panics with error returns. Update all 5 callers in rpc/apis.go.