mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
Handle err returned by rpc.Server.RegisterName (#2910)
This commit is contained in:
committed by
Harshavardhana
parent
84acc820c7
commit
b59bac670a
@@ -79,7 +79,7 @@ type controlAPIHandlers struct {
|
||||
}
|
||||
|
||||
// Register control RPC handlers.
|
||||
func registerControlRPCRouter(mux *router.Router, srvCmdConfig serverCmdConfig) {
|
||||
func registerControlRPCRouter(mux *router.Router, srvCmdConfig serverCmdConfig) (err error) {
|
||||
// Initialize Control.
|
||||
ctrlHandlers := &controlAPIHandlers{
|
||||
ObjectAPI: newObjectLayerFn,
|
||||
@@ -89,8 +89,12 @@ func registerControlRPCRouter(mux *router.Router, srvCmdConfig serverCmdConfig)
|
||||
}
|
||||
|
||||
ctrlRPCServer := rpc.NewServer()
|
||||
ctrlRPCServer.RegisterName("Control", ctrlHandlers)
|
||||
err = ctrlRPCServer.RegisterName("Control", ctrlHandlers)
|
||||
if err != nil {
|
||||
return traceError(err)
|
||||
}
|
||||
|
||||
ctrlRouter := mux.NewRoute().PathPrefix(reservedBucket).Subrouter()
|
||||
ctrlRouter.Path(controlPath).Handler(ctrlRPCServer)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user