From 610eb0cfda9ce3691d07d6947775b93fd6b4dd9d Mon Sep 17 00:00:00 2001 From: mr Date: Mon, 23 Sep 2024 10:34:08 +0200 Subject: [PATCH] print to find bug --- models/peer/peer_cache.go | 4 ++-- models/workflow/workflow_mongo_accessor.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/peer/peer_cache.go b/models/peer/peer_cache.go index 7e4f44f..071fee4 100644 --- a/models/peer/peer_cache.go +++ b/models/peer/peer_cache.go @@ -125,13 +125,13 @@ func (p *PeerCache) exec(url string, method tools.METHOD, body map[string]interf } var m map[string]interface{} json.Unmarshal(b, &m) - fmt.Println("response", err) if err != nil { + fmt.Println("response", err) return err } if e, ok := m["error"]; !ok && e != "" { // Check if there is an error in the response return errors.New(fmt.Sprintf("%v", m["error"])) } - return err + return nil } diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index 8fa1ea1..2927403 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -144,8 +144,8 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w ResourceID: dc_id, // set the datacenter id "WHERE" Executions: execs, // set the executions to book "WHAT" }).Serialize(), wfa.Caller) - fmt.Println("BOOKING", err) if err != nil { + fmt.Println("BOOKING", err) return err } }