瀏覽代碼

opt: 补充出错时的返回结果

liufan 1 月之前
父節點
當前提交
86a968667d
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      server/CertificateCloudflareServer.go

+ 6 - 0
server/CertificateCloudflareServer.go

@@ -42,6 +42,12 @@ func (s *CertificateServer) ListZoneCertificates(ctx context.Context, requestClo
 	}
 	ctxAPI := context.Background()
 	response, err := api.ListSSL(ctxAPI, requestCloudflare.GetZoneId())
+	if err != nil {
+		return &cert.ListZoneCertificatesReplyCloudflare{
+			Result:  nil,
+			Success: false,
+		}, err
+	}
 	list := make([]*cert.ZoneCustomSSL, len(response))
 	for i, detail := range response {
 		list[i] = Go2ProtoCertificate(detail)