MetaMask / MetaMask/snaps

Review validation errors thrown

Open
#1,385 0 comments 0 reactions 0 assignees View on GitHub
Epic snaps-prioritized-2023-oct
Dominant language
TypeScript
Stars
853
Forks
662
Avg merge
2d 8h
Merged PRs (30d)
8

Description

Sometimes the errors thrown by superstruct are hard to understand because they don't include any details from the validation itself.

We should review the error messages we throw and try to improve them.

Example:
```
Failed to fetch Snap "local:http://localhost:8080/": At path: initialPermissions.endowment:cronjob.jobs.0.expression -- Expected a value of type string, but received: "0 0/1 0 ? * * *"
```

Contributor guide

Open the contributing guide

Research direction

Start by locating where Superstruct validation errors are caught and formatted, then compare the current output with the example in the issue. Done means the error messages consistently expose useful validation details and relevant tests cover the improved wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.