Skip to content

Commit

Permalink
chat2.nim: catch any possible exception when stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Dec 7, 2023
1 parent d2db074 commit d528605
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ proc writeAndPrint(c: Chat) {.async.} =

echo "quitting..."

await c.node.stop()
try:
await c.node.stop()
except:
echo "exception happened when stopping: " & getCurrentExceptionMsg()

quit(QuitSuccess)
else:
Expand Down

0 comments on commit d528605

Please sign in to comment.