Skip to content

Commit

Permalink
fix: avoid crash when an unexpected message arrives (#1019)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Zarecky <[email protected]>
Iskander508 authored Sep 9, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 543437c commit 2cfadd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/agent/Agent.ts
Original file line number Diff line number Diff line change
@@ -137,7 +137,13 @@ export class Agent {
.observable<AgentMessageReceivedEvent>(AgentEventTypes.AgentMessageReceived)
.pipe(
takeUntil(this.agentConfig.stop$),
concatMap((e) => this.messageReceiver.receiveMessage(e.payload.message, { connection: e.payload.connection }))
concatMap((e) =>
this.messageReceiver
.receiveMessage(e.payload.message, { connection: e.payload.connection })
.catch((error) => {
this.logger.error('Failed to process message', { error })
})
)
)
.subscribe()
}

0 comments on commit 2cfadd9

Please sign in to comment.