Commit 1e853451 authored by AlexStocks's avatar AlexStocks

Mod: bug fix to run

parent 7cdc4714
...@@ -17,6 +17,7 @@ import ( ...@@ -17,6 +17,7 @@ import (
import ( import (
"github.com/AlexStocks/getty/rpc" "github.com/AlexStocks/getty/rpc"
log "github.com/AlexStocks/log4go"
jerrors "github.com/juju/errors" jerrors "github.com/juju/errors"
config "github.com/koding/multiconfig" config "github.com/koding/multiconfig"
) )
...@@ -42,7 +43,7 @@ func initConf() { ...@@ -42,7 +43,7 @@ func initConf() {
return return
} }
conf := new(rpc.ClientConfig) conf = new(rpc.ClientConfig)
config.MustLoadWithPath(confFile, conf) config.MustLoadWithPath(confFile, conf)
if err := conf.CheckValidity(); err != nil { if err := conf.CheckValidity(); err != nil {
panic(jerrors.ErrorStack(err)) panic(jerrors.ErrorStack(err))
......
...@@ -131,6 +131,7 @@ func test() { ...@@ -131,6 +131,7 @@ func test() {
var errResult int var errResult int
err = client.Call(rpc.CodecJson, "127.0.0.1:20000", "TestRpc", "Err", 2, &errResult) err = client.Call(rpc.CodecJson, "127.0.0.1:20000", "TestRpc", "Err", 2, &errResult)
if err != nil { if err != nil {
// error test case, this invocation should step into this branch.
log.Error("client.Call(TestRpc::Err) = error:%s", jerrors.ErrorStack(err)) log.Error("client.Call(TestRpc::Err) = error:%s", jerrors.ErrorStack(err))
return return
} }
......
...@@ -18,8 +18,8 @@ import ( ...@@ -18,8 +18,8 @@ import (
import ( import (
"github.com/AlexStocks/getty/rpc" "github.com/AlexStocks/getty/rpc"
log "github.com/AlexStocks/log4go" log "github.com/AlexStocks/log4go"
config "github.com/koding/multiconfig"
jerrors "github.com/juju/errors" jerrors "github.com/juju/errors"
config "github.com/koding/multiconfig"
) )
const ( const (
...@@ -42,6 +42,7 @@ func initConf() { ...@@ -42,6 +42,7 @@ func initConf() {
panic(fmt.Sprintf("application configure file name{%v} suffix must be .toml", confFile)) panic(fmt.Sprintf("application configure file name{%v} suffix must be .toml", confFile))
return return
} }
conf = &rpc.ServerConfig{}
config.MustLoadWithPath(confFile, conf) config.MustLoadWithPath(confFile, conf)
if err := conf.CheckValidity(); err != nil { if err := conf.CheckValidity(); err != nil {
panic(jerrors.ErrorStack(err)) panic(jerrors.ErrorStack(err))
......
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