Handle err returned by rpc.Server.RegisterName (#2910)

This commit is contained in:
Krishnan Parthasarathi
2016-10-13 11:43:24 +05:30
committed by Harshavardhana
parent 84acc820c7
commit b59bac670a
7 changed files with 56 additions and 21 deletions

View File

@@ -30,14 +30,18 @@ type s3PeerAPIHandlers struct {
ObjectAPI func() ObjectLayer
}
func registerS3PeerRPCRouter(mux *router.Router) {
func registerS3PeerRPCRouter(mux *router.Router) error {
s3PeerHandlers := &s3PeerAPIHandlers{
ObjectAPI: newObjectLayerFn,
}
s3PeerRPCServer := rpc.NewServer()
s3PeerRPCServer.RegisterName("S3", s3PeerHandlers)
err := s3PeerRPCServer.RegisterName("S3", s3PeerHandlers)
if err != nil {
return traceError(err)
}
s3PeerRouter := mux.NewRoute().PathPrefix(reservedBucket).Subrouter()
s3PeerRouter.Path(s3Path).Handler(s3PeerRPCServer)
return nil
}