mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
wrap error to make the message clear
This commit is contained in:
parent
8cc5db7506
commit
f4066b18b3
|
@ -45,15 +45,15 @@ func LoadExchangeStrategies(configFile string) (strategies []bbgo.SingleExchange
|
|||
val := reflect.New(rt)
|
||||
|
||||
// now we have &(*Strategy) -> **Strategy
|
||||
valinf := val.Interface()
|
||||
valRef := val.Interface()
|
||||
|
||||
plain, err := json.Marshal(conf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(plain, valinf); err != nil {
|
||||
return nil, err
|
||||
if err := json.Unmarshal(plain, valRef); err != nil {
|
||||
return nil, errors.Wrapf(err, "json parsing error, given payload: %s", plain)
|
||||
}
|
||||
|
||||
strategies = append(strategies, val.Elem().Interface().(bbgo.SingleExchangeStrategy))
|
||||
|
|
Loading…
Reference in New Issue
Block a user