File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import yaml
22from collections import deque , defaultdict
3+ from loguru import logger
34
45
56def convert_raw_to_processed (raw_yaml : str ) -> str :
@@ -27,6 +28,12 @@ def convert_raw_to_processed(raw_yaml: str) -> str:
2728 source = edge ['source' ]
2829 target = edge ['target' ]
2930
31+ if source not in id_to_node :
32+ logger .error (f"edges中引用的source节点 '{ source } ' 不存在于process中!" )
33+ raise ValueError (f"edges中引用的source节点 '{ source } ' 不存在于process中!" )
34+ if target not in id_to_node :
35+ logger .error (f"edges中引用的target节点 '{ target } ' 不存在于process中!" )
36+ raise ValueError (f"edges中引用的target节点 '{ target } ' 不存在于process中!" )
3037
3138 adj [source ].append (target )
3239 in_degree [target ] += 1
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ async def create_algo_template(
133133
134134 except Exception as e :
135135 logger .error (f"创建算法模板失败: { e } " )
136- return response_fail (msg = "创建失败" )
136+ return response_fail (msg = "创建模版失败:" + str ( e ) )
137137 finally :
138138 db .close ()
139139
@@ -179,7 +179,7 @@ async def update_algo_template(
179179
180180 except Exception as e :
181181 logger .error (f"更新算法模板失败: { e } " )
182- return response_fail (msg = "更新失败" )
182+ return response_fail (msg = "算法更新失败:" + str ( e ) )
183183 finally :
184184 db .close ()
185185
You can’t perform that action at this time.
0 commit comments