added error handling
This commit is contained in:
parent
4e3ff9aa08
commit
83e590d4e1
@ -2,6 +2,7 @@ package bill
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -186,7 +187,11 @@ type PeerItemOrder struct {
|
||||
func (d *PeerItemOrder) GetPrice(request *tools.APIRequest) (float64, error) {
|
||||
var priced *resources.PricedResource
|
||||
b, _ := json.Marshal(d.Item)
|
||||
json.Unmarshal(b, priced)
|
||||
err := json.Unmarshal(b, priced)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return 0, err
|
||||
}
|
||||
accessor := purchase_resource.NewAccessor(request)
|
||||
search, code, _ := accessor.Search(&dbs.Filters{
|
||||
And: map[string][]dbs.Filter{
|
||||
|
Loading…
Reference in New Issue
Block a user