Skip to content

Commit e5b8945

Browse files
committed
add error output during create application and function
1 parent 2811a80 commit e5b8945

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

veadk/integrations/ve_faas/ve_faas.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def _create_function(self, function_name: str, path: str):
120120
envs=envs,
121121
)
122122
)
123+
logger.debug(f"Function creation response: {res}")
124+
123125
function_id = res.id
124126

125127
# Upload and mount code using extracted method
@@ -157,9 +159,14 @@ def _create_application(
157159
region="cn-beijing",
158160
host="open.volcengineapi.com",
159161
)
160-
assert response["Result"]["Status"] == "create_success"
161162

162-
return response["Result"]["Id"]
163+
try:
164+
if response["Result"]["Status"] == "create_success":
165+
return response["Result"]["Id"]
166+
else:
167+
raise ValueError(f"Create application failed: {response}")
168+
except Exception as _:
169+
raise ValueError(f"Create application failed: {response}")
163170

164171
def _release_application(self, app_id: str):
165172
_ = ve_request(

0 commit comments

Comments
 (0)