Problem
All ExternalDataProvider methods are supplied by the wallet and can throw (network errors, rejected signatures, bugs). Every call site in src/formatters.ts wraps the provider call in try/catch and falls back to a warning:
resolveChainInfo (formatters.ts:171, :271, :798)
resolveToken (formatters.ts:296, :1161)
resolveNftCollectionName (formatters.ts:498)
resolveBlockTimestamp (formatters.ts:587)
resolveLocalName / resolveEnsName (formatters.ts:1039, :1058)
The one exception is resolveDecryptedValue in decryptFieldValue (src/fields.ts:972). The call is not wrapped. If the wallet callback throws, the error goes up through processSingleField and the whole format() call rejects. Only the later hexToBytes(result.value) has a try.
Expected behavior
Catch a thrown error from resolveDecryptedValue and return a DECRYPTION_FAILED warning, consistent with the other handlers. The field then renders the fallbackLabel / [Encrypted] placeholder with rawEncryptedValue set.
Tasks
Problem
All
ExternalDataProvidermethods are supplied by the wallet and can throw (network errors, rejected signatures, bugs). Every call site insrc/formatters.tswraps the provider call intry/catchand falls back to a warning:resolveChainInfo(formatters.ts:171,:271,:798)resolveToken(formatters.ts:296,:1161)resolveNftCollectionName(formatters.ts:498)resolveBlockTimestamp(formatters.ts:587)resolveLocalName/resolveEnsName(formatters.ts:1039,:1058)The one exception is
resolveDecryptedValueindecryptFieldValue(src/fields.ts:972). The call is not wrapped. If the wallet callback throws, the error goes up throughprocessSingleFieldand the wholeformat()call rejects. Only the laterhexToBytes(result.value)has atry.Expected behavior
Catch a thrown error from
resolveDecryptedValueand return aDECRYPTION_FAILEDwarning, consistent with the other handlers. The field then renders thefallbackLabel/[Encrypted]placeholder withrawEncryptedValueset.Tasks
resolveDecryptedValuecall insrc/fields.tsintry/catchand map a throw toDECRYPTION_FAILED.test/registry-cases/zama/zama.spec.tsfor a provider that throws.CLAUDE.md: document that everyExternalDataProvidercall must be wrapped intry/catchbecause the methods are user-provided and can throw; a throw must become a warning, never a rejectedformat()call. Add the throw case to theDECRYPTION_FAILEDlist in the Encrypted Fields section.GUIDE.mdandDECRYPTION.mdfor statements about error handling of provider methods.