Skip to content

fix(contract_manager): include filename in JSON parse errors#3622

Open
dhruvja wants to merge 1 commit intopyth-network:mainfrom
dhruvja:fix/json-parse-filename-context
Open

fix(contract_manager): include filename in JSON parse errors#3622
dhruvja wants to merge 1 commit intopyth-network:mainfrom
dhruvja:fix/json-parse-filename-context

Conversation

@dhruvja
Copy link
Copy Markdown

@dhruvja dhruvja commented Apr 22, 2026

Summary

contract_manager loads chain/contract/token/vault configs via four JSON.parse(readFileSync(...)) calls. A syntax error in any config file crashes the CLI with a bare SyntaxError and no filename, making it painful to track down typos when editing configs. This wraps the calls in a small parseJsonFile helper that re-throws with the offending filename prepended.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

@dhruvja is attempting to deploy a commit to the Pyth Network Team on Vercel.

A member of the Team first needs to authorize it.

@vercel vercel Bot temporarily deployed to Preview – proposals April 22, 2026 07:26 Inactive
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
proposals Skipped Skipped Apr 22, 2026 7:26am

Request Review

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.

1 participant