Skip to content

fix: clarify invalid footprint function errors#647

Open
ItsOtherMauridian wants to merge 1 commit into
tscircuit:mainfrom
ItsOtherMauridian:fix/invalid-footprint-diagnostic-local
Open

fix: clarify invalid footprint function errors#647
ItsOtherMauridian wants to merge 1 commit into
tscircuit:mainfrom
ItsOtherMauridian:fix/invalid-footprint-diagnostic-local

Conversation

@ItsOtherMauridian
Copy link
Copy Markdown

Summary

Fixes #46.

Invalid footprint strings currently throw a generic parser error such as Invalid footprint function, got "invalid".... This PR makes that diagnostic point to the missing footprinter function directly and suggests valid examples.

Example new error:

Function not found for footprinter "invalid". Specify a valid function like .dip, .lr, .p etc.

The same helper is used for both circuitJson/soup and json paths so the message stays consistent.

Test plan

  • npx bun test tests/string-parser.test.ts tests/fp-string-error.test.ts tests/vssop.test.ts
  • npm run build
  • npx bun test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create better footprint errors

1 participant