Skip to content

Commit

Permalink
feat: add debugging around production error
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 more
  • Loading branch information
travis committed Oct 7, 2024
1 parent 744ca61 commit e663c06
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 e663c06

Please sign in to comment.