From 3a23c8f63abd17ca0038fe3b410f3fe1900edd9e Mon Sep 17 00:00:00 2001 From: Ali Afsharzadeh Date: Sat, 30 Nov 2024 08:00:09 +0330 Subject: [PATCH] Add error handling for router.Run --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f3129d6..06e6a43 100644 --- a/main.go +++ b/main.go @@ -458,7 +458,11 @@ func main() { router.GET("/ping/:chatid/:topicid", GET_Handling) router.POST("/alert/:chatid", POST_Handling) router.POST("/alert/:chatid/:topicid", POST_Handling) - router.Run(*listen_addr) + + err = router.Run(*listen_addr) + if err != nil { + log.Fatal(err) + } } func GET_Handling(c *gin.Context) {