Skip to content

Commit

Permalink
moar logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Nov 17, 2023
1 parent 32157b6 commit 88bedef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/pds/src/api/com/atproto/temp/importRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function (server: Server, ctx: AppContext) {
req.log.error({ err }, 'failed to send ticks')
})
processImport(ctx, did, input.body, outBuffer).catch(async (err) => {
req.log.error({ did, err }, 'failed import')
req.log.error({ did, err }, 'pds-v2-debug failed import')
try {
await ctx.actorStore.destroy(did)
} catch (err) {
Expand Down
16 changes: 14 additions & 2 deletions packages/repo/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ export const diffToWriteDescripts = (
return Promise.all([
...diff.addList().map(async (add) => {
const { collection, rkey } = parseDataKey(add.key)
const value = await parse.getAndParseRecord(blocks, add.cid)
let value
try {
value = await parse.getAndParseRecord(blocks, add.cid)
} catch (err) {
logger.error({ collection, rkey }, 'pds-v2-debug failed to parse value')
throw err
}
return {
action: WriteOpAction.Create,
collection,
Expand All @@ -160,7 +166,13 @@ export const diffToWriteDescripts = (
}),
...diff.updateList().map(async (upd) => {
const { collection, rkey } = parseDataKey(upd.key)
const value = await parse.getAndParseRecord(blocks, upd.cid)
let value
try {
value = await parse.getAndParseRecord(blocks, upd.cid)
} catch (err) {
logger.error({ collection, rkey }, 'pds-v2-debug failed to parse value')
throw err
}
return {
action: WriteOpAction.Update,
collection,
Expand Down

0 comments on commit 88bedef

Please sign in to comment.