You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the server sometimes replies with an error page <!DOCTYPE html>..., which postLeafAndGetTimestamp in WitnessClient doesn't handle, and a SyntaxError is thrown to the application.
Steps to reproduce (happens maybe 1 out of 1000 calls or so):
const witness = new WitnessClient(process.env.WITNESS_API_KEY);
const leafHash = witness.hash("...");
let timestamp = await witness.postLeafAndGetTimestamp(leafHash);
Result:
undefined:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19)
at successSteps (node:internal/deps/undici/undici:5555:27)
at fullyReadBody (node:internal/deps/undici/undici:1665:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async specConsumeBody (node:internal/deps/undici/undici:5564:7)
at async w.getLatestOnchainCheckpoint (/home/olof_andersson/dkim-lookup/dkim-lookup-app/node_modules/.pnpm/@witnessco+client@0.1.14_viem@2.8.18/node_modules/@witnessco/client/dist/index.cjs:1:10868)
at async w.waitForCheckpointedLeafHash (/home/olof_andersson/dkim-lookup/dkim-lookup-app/node_modules/.pnpm/@witnessco+client@0.1.14_viem@2.8.18/node_modules/@witnessco/client/dist/index.cjs:1:8828)
at async w.postLeafAndGetTimestamp (/home/olof_andersson/dkim-lookup/dkim-lookup-app/node_modules/.pnpm/@witnessco+client@0.1.14_viem@2.8.18/node_modules/@witnessco/client/dist/index.cjs:1:9550)
at async generateWitness (/home/olof_andersson/dkim-lookup/dkim-lookup-app/src/lib/generateWitness.ts:2:1306)
The text was updated successfully, but these errors were encountered:
It seems like the server sometimes replies with an error page
<!DOCTYPE html>...
, which postLeafAndGetTimestamp in WitnessClient doesn't handle, and a SyntaxError is thrown to the application.Steps to reproduce (happens maybe 1 out of 1000 calls or so):
Result:
The text was updated successfully, but these errors were encountered: