Utilities in contractReadDiagnostics interpret arbitrary thrown values from Canton JSON API reads and normalize them for retry, benign missing, and error code selection.
Key exports
classifyContractReadFailure(error)→'not_found' | 'visibility' | 'auth' | 'schema' | 'network' | 'unknown'analyzeContractReadFailure(error)→{ classification, retryable, benignMissing }contractReadFailureCode(kind)→ maps toOcpErrorCodescreateDiagnosedContractReadError→OcpContractErrorwithdiagnosticsobject attached (andcause)isRetryableContractReadFailure— HTTP 429 / 502 / 503 / 504 heuristicscontractReadDiagnosticsToOcpContext— shape context forOcpError.context
When used
extractCantonOcfManifest uses these helpers to decide whether to throw, retry, or skip archived contracts.