Skip to content

Commit

Permalink
feat: add debugging around production error (#427)
Browse files Browse the repository at this point in the history
we're seeing this error a LOT in production but don't have much
information to debug from - add a bit of logging to try to figure out what's going on
  • Loading branch information
travis authored Oct 8, 2024
1 parent 744ca61 commit eec7354
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions upload-api/stores/agent/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ export const assert = async (message, { stream, store }) => {
// 🔬 Need to figure if there are consumers downstream that depend on
// having invocation details in the stream record and whether we can
// safely remove it because this additional IO which seems unnecessary.
const { ok: invocation } = await Store.getInvocation(store, task)
const result = await Store.getInvocation(store, task)
const { ok: invocation } = result
if (!invocation) {
throw new NoInvocationFoundForGivenReceiptError()
console.error(result.error)
throw new NoInvocationFoundForGivenReceiptError(
`Could not find invocation with CID ${task.link().toString()} for receipt with CID: ${receipt.link().toString()}`
)
}

// log any likely JSON serialization errors in the receipt
Expand Down

0 comments on commit eec7354

Please sign in to comment.