Closed khanti42 closed 2 months ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
This is closed, because complex superstruct are implemented as : https://github.com/MetaMask/keyring-api/blob/c7068d1d585c116cd8cd2aa2e838429215800de5/src/api.ts#L63-L76 instead of unions.
PR Description: Improved Error Messages for Union Struct Validation
Before:
When testing a
union
struct with multiple levels, such as:If the input was incorrect, for example:
The error message provided was not clear and didn't offer much guidance:
This generic message made it difficult to diagnose the specific issue within the nested structure, particularly when working with complex schemas.
Now:
The error handling has been improved to provide much clearer and more informative messages. With the same incorrect input:
The new error message provides detailed information about where the validation failed:
Benefits:
This PR improves the developer experience and reduce time in debugging.