-
Notifications
You must be signed in to change notification settings - Fork 66
fix(rf, FXC-3797): error message of preprocess modeler #2920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e7880f2 to
cd2fb9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, no comments
dmarek-flex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog?
|
Probably doesn't require it as it's already in the previous async item, users haven't interacted with this |
cd2fb9c to
02b9f15
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/web/api/webapi.pyLines 197-205 197 "protocolVersion": _get_protocol_version(),
198 }
199
200 if verbose:
! 201 console.log("Starting modeler and subtasks validation...")
202
203 initial_resp = http.post(split_path, payload)
204 split_job_detail = AsyncJobDetail(**initial_resp)
205 monitor_split_path = f"{split_path}?asyncId={split_job_detail.asyncId}"Lines 233-242 233 break
234 time.sleep(RUN_REFRESH_TIME)
235
236 if split_job_detail.status in ERROR_STATES:
! 237 msg = split_job_detail.result or "An unknown error occurred."
! 238 final_error = WebError(
239 f"Component modeler split job failed ({split_job_detail.status}): {msg}"
240 )
241
242 if not final_error:Lines 279-288 279 time.sleep(RUN_REFRESH_TIME)
280
281 # Check for split job failure.
282 if split_job_detail.status in ERROR_STATES:
! 283 msg = split_job_detail.result or "An unknown error occurred."
! 284 final_error = WebError(
285 f"Component modeler split job failed ({split_job_detail.status}): {msg}"
286 )
287
288 # If split succeeded, poll for validation completion. |
Greptile Overview
Updated On: 2025-10-22 15:12:38 UTC
Greptile Summary
This PR fixes error message handling in the Component Modeler preprocessing workflow within
tidy3d/web/api/webapi.py. The changes correct a critical bug where error details were being retrieved from the wrong field (messageinstead ofresult) when split job preprocessing fails. The error messages are enhanced to include status information (e.g., "failed", "error") for improved debugging context. Additionally, a console log message is updated to use lowercase capitalization, aligning with the codebase's established logging conventions. These changes ensure that users receive accurate and informative error messages when Component Modeler preprocessing encounters issues, improving the overall debugging experience for the web API component of Tidy3D.Important Files Changed
Changed Files
messagetoresult, added status information to error messages, and corrected console log capitalizationConfidence score: 5/5
Sequence Diagram
sequenceDiagram participant User participant upload participant SimulationTask participant _upload_component_modeler_subtasks participant http participant Server participant _batch_detail_error participant BatchTask User->>upload: "upload(simulation, task_name, ...)" upload->>SimulationTask: "create(task_type='RF', ...)" SimulationTask->>Server: "POST create task" Server-->>SimulationTask: "task with batch_id" SimulationTask-->>upload: "task object" upload->>_upload_component_modeler_subtasks: "resource_id, verbose, solver_version" _upload_component_modeler_subtasks->>http: "POST tidy3d/async-biz/component-modeler-split" http-->>_upload_component_modeler_subtasks: "AsyncJobDetail" loop Poll split job status _upload_component_modeler_subtasks->>http: "GET monitor_split_path" http-->>_upload_component_modeler_subtasks: "AsyncJobDetail with progress" end alt Split job succeeds _upload_component_modeler_subtasks->>BatchTask: "check(solver_version, batch_type='RF_SWEEP')" BatchTask->>Server: "POST validation request" loop Poll validation status _upload_component_modeler_subtasks->>BatchTask: "detail(batch_type='RF_SWEEP')" BatchTask->>Server: "GET batch details" Server-->>BatchTask: "BatchDetail" BatchTask-->>_upload_component_modeler_subtasks: "BatchDetail" end alt Validation fails _upload_component_modeler_subtasks->>_batch_detail_error: "resource_id" _batch_detail_error->>BatchTask: "detail(batch_type='RF_SWEEP')" BatchTask->>Server: "GET batch details" Server-->>BatchTask: "BatchDetail with validateErrors" BatchTask-->>_batch_detail_error: "BatchDetail" loop Parse validation errors _batch_detail_error->>_batch_detail_error: "json.loads(error_str)" _batch_detail_error->>_batch_detail_error: "extract validation_error" end _batch_detail_error-->>_upload_component_modeler_subtasks: "WebError with details" _upload_component_modeler_subtasks-->>upload: "WebError" upload-->>User: "raise WebError" else Validation succeeds _upload_component_modeler_subtasks-->>upload: "None (success)" end else Split job fails _upload_component_modeler_subtasks-->>upload: "WebError" upload-->>User: "raise WebError" end upload->>upload: "estimate_cost(resource_id, ...)" upload-->>User: "return resource_id"Context used:
dashboard- Use single quotes around class names like 'WavePort' in error messages and warnings. Use double back... (source)