Surface real simulation error in schsim instead of generic "no graphs" message - #1688
Open
rushabhcodes wants to merge 2 commits into
Open
Surface real simulation error in schsim instead of generic "no graphs" message#1688rushabhcodes wants to merge 2 commits into
rushabhcodes wants to merge 2 commits into
Conversation
…" message When a SPICE run fails, tscircuit-core inserts a simulation_unknown_experiment_error element carrying the real failure message (e.g. the underlying ngspice error) instead of producing any simulation_transient_voltage_graph elements. circuit-to-svg then only reports the generic "No simulation_transient_voltage_graph elements found" message, masking the actual cause. The schsim handler now detects simulation_unknown_experiment_error elements for the resolved experiment id (or with no experiment id, since core may leave it undefined) and throws the real message, which flows through errorResponse into the same "Compilation Error" box. Adds tests covering both a successful ammeter board render and the error-surfacing path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The schematic-simulation (
svg_type=schsim) endpoint reports:This is a symptom, not the cause. When a SPICE run fails,
@tscircuit/corecatches the engine error and inserts asimulation_unknown_experiment_errorelement (carrying the real ngspice message) instead of producing any graphs.circuit-to-svgthen throws the generic "no graphs found" error, masking the actual failure.Fix
handlers/schematic-simulation-svg.tsnow scans the circuit JSON forsimulation_unknown_experiment_errorelements matching the resolved experiment id (or with no experiment id, since core may leave it undefined) and throws the realmessage. It flows througherrorResponseinto the same "Compilation Error" box, so users see the actual cause instead of the generic text.Tests
Adds
tests/schematic-simulation-error-svg.test.ts:VOUTvoltage graph id).simulation_unknown_experiment_error) and asserts the real message surfaces while the generic"No simulation_transient_voltage_graph elements found"does not. Fails without the handler change.Existing
tests/schematic-simulation-svg.test.tsstill passes; changes are biome-formatted.🤖 Generated with Claude Code