Skip to content

Commit d1eb3c2

Browse files
committed
Improve listen_webhooks try/except to incorporate all code that can fail
1 parent 4c83eab commit d1eb3c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libs/aries-basic-controller/aries_basic_controller/aries_controller.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ def remove_all_listeners(self, topic: str = None):
190190

191191

192192
async def listen_webhooks(self):
193-
app = web.Application()
194-
app.add_routes([web.post(self.webhook_base + "/topic/{topic}/", self._receive_webhook)])
195-
runner = web.AppRunner(app)
196193
try:
194+
app = web.Application()
195+
app.add_routes([web.post(self.webhook_base + "/topic/{topic}/", self._receive_webhook)])
196+
runner = web.AppRunner(app)
197197
await runner.setup()
198198
self.webhook_site = web.TCPSite(runner, self.webhook_host, self.webhook_port)
199199
await self.webhook_site.start()

0 commit comments

Comments
 (0)