@@ -125,24 +125,22 @@ def _batch_detail_error(resource_id: str) -> Optional[WebError]:
125125 return
126126
127127 if hasattr (batch_detail , "validateErrors" ) and batch_detail .validateErrors :
128- error_details = []
129- for key , error_str in batch_detail .validateErrors .items ():
130- try :
131- error_dict = json .loads (error_str )
132- validation_error = error_dict .get ("validation_error" , "Unknown validation error." )
133- msg = f"- Subtask '{ key } ' failed: { validation_error } "
134- log .error (msg )
128+ try :
129+ error_details = []
130+ for key , error_str in batch_detail .validateErrors .items ():
131+ msg = f"- Subtask '{ key } ' failed: { error_str } "
135132 error_details .append (msg )
136- except (json .JSONDecodeError , TypeError ):
137- # Handle cases where the error string isn't valid JSON
138- log .error (f"Could not parse validation error for subtask '{ key } '." )
139- error_details .append (f"- Subtask '{ key } ': Could not parse error details." )
140-
141- details_string = "\n " .join (error_details )
142- full_error_msg = (
143- "One or more subtasks failed validation. Please fix the component modeler configuration.\n "
144- f"Details:\n { details_string } "
145- )
133+
134+ details_string = "\n " .join (error_details )
135+ full_error_msg = (
136+ "One or more subtasks failed validation. Please fix the component modeler "
137+ "configuration.\n "
138+ f"Details:\n { details_string } "
139+ )
140+ except Exception as e :
141+ raise WebError (
142+ "One or more subtasks failed validation. Failed to parse validation errors."
143+ ) from e
146144 raise WebError (full_error_msg )
147145
148146 # Handle all other generic error states
@@ -864,7 +862,7 @@ def monitor_preprocess() -> None:
864862 if verbose :
865863 # verbose case, update progressbar
866864 console .log ("running solver" )
867- if task_type == "FDTD" :
865+ if "FDTD" in task_type :
868866 with Progress (console = console ) as progress :
869867 pbar_pd = progress .add_task ("% done" , total = 100 )
870868 perc_done , _ = get_run_info (task_id )
@@ -1472,8 +1470,10 @@ def estimate_cost(
14721470 console = get_logging_console () if verbose else None
14731471
14741472 task = TaskFactory .get (task_id , verbose = False )
1473+ detail = task .detail ()
14751474 if isinstance (task , BatchTask ):
1476- task .check (solver_version = solver_version )
1475+ check_task_type = "FDTD" if detail .taskType == "MODAL_CM" else "RF_FDTD"
1476+ task .check (solver_version = solver_version , check_task_type = check_task_type )
14771477 detail = task .detail ()
14781478 status = detail .status .lower ()
14791479 while status not in ALL_POST_VALIDATE_STATES :
@@ -1593,7 +1593,7 @@ def real_cost(task_id: str, verbose: bool = True) -> float | None:
15931593 else :
15941594 if verbose :
15951595 console .log (f"Billed flex credit cost: { flex_unit :1.3f} ." )
1596- if flex_unit != ori_flex_unit and task_info . taskType == "FDTD" :
1596+ if flex_unit != ori_flex_unit and "FDTD" in task_info . taskType :
15971597 console .log (
15981598 "Note: the task cost pro-rated due to early shutoff was below the minimum "
15991599 "threshold, due to fast shutoff. Decreasing the simulation 'run_time' should "
0 commit comments