Fix pcbStraightLine render crash when fewer than two ports connected#2561
Draft
posthog[bot] wants to merge 1 commit into
Draft
Fix pcbStraightLine render crash when fewer than two ports connected#2561posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
When a `pcbStraightLine` manual trace resolves fewer than two connected ports, the render aborted with an unhandled exception because `renderError` throws a raw `Error` for string messages. Insert a `pcb_trace_error` and return instead, matching the sibling error paths in the same file. The misconfiguration now surfaces as a proper trace error the UI can show, rather than taking down the whole circuit render. Generated-By: PostHog Code Task-Id: 150cbbb0-57db-42cf-89a7-eaceaf0d4980
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
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.
A
pcbStraightLinemanual trace that resolved fewer than two connected ports (e.g. a trace connecting a port to a net) aborted the entire circuit render with an unhandled exception.Trace_doInitialPcbManualTraceRendercalledtrace.renderError(...), andrenderErrorthrows a rawErrorfor string messages — so it bubbled up throughrenderUntilSettledinstead of being a soft render error.This swaps that throwing call for a
db.pcb_trace_error.insert(...)+return, matching every sibling error path in the same file. The misconfiguration now surfaces as a properpcb_trace_errorthe UI can display, and the rest of the render completes.Why: users of
pcbStraightLinehit a full render crash with no workaround when a trace did not resolve exactly two connected ports; this makes it a graceful, contained error instead.Added a regression test that connects a single port to a net with
pcbStraightLineand asserts the render settles with onepcb_trace_error.Created with PostHog Code from an inbox report.