Skip to content

Commit

Permalink
fix: avoid crash when an unexpected message arrives (openwallet-found…
Browse files Browse the repository at this point in the history
…ation#1019)

Signed-off-by: Pavel Zarecky <[email protected]>
  • Loading branch information
Iskander508 authored and genaris committed Sep 16, 2022
1 parent 8130d14 commit 9b0c1f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions packages/core/src/agent/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ export class Agent<AgentModules extends AgentModulesInput = ModulesMap> extends
.pipe(
takeUntil(stop$),
concatMap((e) =>
this.messageReceiver.receiveMessage(e.payload.message, {
connection: e.payload.connection,
contextCorrelationId: e.payload.contextCorrelationId,
})
this.messageReceiver
.receiveMessage(e.payload.message, {
connection: e.payload.connection,
contextCorrelationId: e.payload.contextCorrelationId,
})
.catch((error) => {
this.logger.error('Failed to process message', { error })
})
)
)
.subscribe()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ export class DidCommDocumentService {

return didCommServices
}
}
}

0 comments on commit 9b0c1f1

Please sign in to comment.