This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
The following commit(s) were added to refs/heads/master by this push:
new 6b6a987 cmd: on async job error, also print job response
6b6a987 is described below
commit 6b6a987e7cd812faa4d4e7c099485360ee117264
Author: Rohit Yadav <[email protected]>
AuthorDate: Sat Jun 23 21:06:27 2018 +0530
cmd: on async job error, also print job response
Signed-off-by: Rohit Yadav <[email protected]>
---
cmd/api.go | 3 +++
cmd/network.go | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/cmd/api.go b/cmd/api.go
index 9237ff5..7e0621a 100644
--- a/cmd/api.go
+++ b/cmd/api.go
@@ -162,6 +162,9 @@ func init() {
response, err := NewAPIRequest(r, api.Name, apiArgs,
api.Async)
if err != nil {
+ if response != nil {
+ printResult(r.Config.Core.Output,
response, nil)
+ }
return err
}
diff --git a/cmd/network.go b/cmd/network.go
index c55998f..2def7f6 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -143,7 +143,7 @@ func pollAsyncJob(r *Request, jobId string)
(map[string]interface{}, error) {
}
if jobStatus == 2 {
- return queryResult, errors.New("async API job failed")
+ return queryResult, errors.New("async API failed for
job " + jobId)
}
}
return nil, errors.New("async API job query timed out")