Skip to content

Commit 19f3561

Browse files
liuhuiqi.7潘婉宁
authored andcommitted
fix: error msg from ark-auth
Change-Id: I3a1b569fecf6e6e334615e385016834aca3768ce
1 parent 3a4cb10 commit 19f3561

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

volcenginesdkarkruntime/_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ def _load_api_key(
379379

380380

381381
class CertificateResponse(BaseModel):
382+
error: Dict[str, str] = None
383+
"""The error information."""
384+
382385
Certificate: str
383386
"""The certificate content."""
384387

@@ -455,8 +458,8 @@ def _sync_load_cert_by_auth(self, ep: str) -> str:
455458
)
456459
except Exception as e:
457460
raise ArkAPIError("Getting Certificate failed: %s\n" % e)
458-
if "error" in resp:
459-
raise ArkAPIError("Getting Certificate failed: %s\n" % resp["error"])
461+
if resp.error is not None:
462+
raise ArkAPIError("Getting Certificate failed: %s\n" % resp.error)
460463
return resp.Certificate
461464

462465
def _save_cert_to_file(self, ep: str, cert_pem: str):

0 commit comments

Comments
 (0)