Commit e23d19e2 authored by ChaiShushan's avatar ChaiShushan Committed by Rob Pike

net/rpc: use log.Print and return error instead log.Fatal

R=r
CC=golang-dev
https://golang.org/cl/10758044
parent 47a89693
......@@ -247,10 +247,12 @@ func (server *Server) register(rcvr interface{}, name string, useName bool) erro
sname = name
}
if sname == "" {
log.Fatal("rpc: no service name for type", s.typ.String())
s := "rpc.Register: no service name for type " + s.typ.String()
log.Print(s)
return errors.New(s)
}
if !isExported(sname) && !useName {
s := "rpc Register: type " + sname + " is not exported"
s := "rpc.Register: type " + sname + " is not exported"
log.Print(s)
return errors.New(s)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment