fix: replace misleading error messages in key fetching#1
Open
luchobonatti wants to merge 1 commit intomainfrom
Open
fix: replace misleading error messages in key fetching#1luchobonatti wants to merge 1 commit intomainfrom
luchobonatti wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates key-fetching error messages to be neutral and resource-specific, replacing a misleading catch-all message and standardizing errors around TFHEError so underlying causes surface consistently.
Changes:
- Replaced the generic “wrong relayer url” message with resource-specific messages for public key / CRS / PKE params fetches.
- Switched
getKeysFromRelayerto throwTFHEErrorwith a neutral “Failed to fetch keys from relayer” message. - Updated affected unit tests to assert the new messages.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/relayer-provider/v1/networkV1.ts | Wrap key-fetch failures in TFHEError with a neutral message. |
| src/sdk/lowlevel/TFHEPublicKey.ts | Update fetch wrapper message to “Failed to fetch public key”. |
| src/sdk/lowlevel/TFHEPkeCrs.ts | Update fetch wrapper message to “Failed to fetch CRS”. |
| src/sdk/lowlevel/TFHEPkeParams.ts | Update fetch wrapper message to “Failed to fetch PKE params”. |
| src/sdk/lowlevel/TFHEPublicKey.test.ts | Update assertions to match the new public key fetch error message. |
| src/sdk/lowlevel/TFHEPkeCrs.test.ts | Update assertions to match the new CRS fetch error message. |
| src/sdk/lowlevel/TFHEPkeParams.test.ts | Update assertions to match the new PKE params fetch error message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Closes zama-ai#379
Summary
"Impossible to fetch public key: wrong relayer url."with neutral, resource-specific messages usingTFHEErrorcause.messageis now auto-surfaced asDetails:viaRelayerErrorBase, fixing the problem of environments that don't supportError.causeChanges
src/relayer-provider/v1/networkV1.tsTFHEErrorwith"Failed to fetch keys from relayer"src/sdk/lowlevel/TFHEPublicKey.ts"Failed to fetch public key"src/sdk/lowlevel/TFHEPkeCrs.ts"Failed to fetch CRS"src/sdk/lowlevel/TFHEPkeParams.ts"Failed to fetch PKE params"src/sdk/lowlevel/TFHEPublicKey.test.tssrc/sdk/lowlevel/TFHEPkeCrs.test.tssrc/sdk/lowlevel/TFHEPkeParams.test.tsTest plan
prettier:checkpasseseslintpasses