mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
修复: aliyun创建主机失败时,正确返回失败信息
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package aliyun
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||
|
||||
@@ -69,6 +71,10 @@ func _jsonRequest(client *sdk.Client, domain string, version string, apiName str
|
||||
log.Errorf("parse json fail %s", err)
|
||||
return nil, err
|
||||
}
|
||||
//{"Code":"InvalidInstanceType.ValueNotSupported","HostId":"ecs.aliyuncs.com","Message":"The specified instanceType beyond the permitted range.","RequestId":"0042EE30-0EDF-48A7-A414-56229D4AD532"}
|
||||
if body.Contains("Code") {
|
||||
return nil, fmt.Errorf(body.String())
|
||||
}
|
||||
return body, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user