mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix: avoid nil pointer
This commit is contained in:
@@ -161,11 +161,13 @@ type OpenstackError struct {
|
||||
}
|
||||
|
||||
func (ce *OpenstackError) ParseErrorFromJsonResponse(statusCode int, body jsonutils.JSONObject) error {
|
||||
body.Unmarshal(ce)
|
||||
if body != nil {
|
||||
body.Unmarshal(ce)
|
||||
}
|
||||
if ce.Code == 0 {
|
||||
ce.Code = statusCode
|
||||
}
|
||||
if len(ce.Details) == 0 {
|
||||
if len(ce.Details) == 0 && body != nil {
|
||||
ce.Details = body.String()
|
||||
}
|
||||
if len(ce.Class) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user