From dd715179790d85572d1e9c67228bab8a181aa94a Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Fri, 10 Jan 2020 22:15:21 +0100 Subject: [PATCH] Log the types of encountered errors --- whapp-handler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/whapp-handler.go b/whapp-handler.go index 2de4101..1c6be28 100644 --- a/whapp-handler.go +++ b/whapp-handler.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "log" "github.com/Rhymen/go-whatsapp" @@ -26,8 +27,10 @@ func (h *WhappHandler) HandleError(err error) { } } - logString := "Whatsapp Error: " + err.Error() + typeLogString := fmt.Sprintf("Whatsapp Error of type: %T", err) + log.Println(typeLogString) + logString := "Whatsapp Error: " + err.Error() log.Println(logString) // Invalid ws data seems to be pretty common, let's not bore the user with that.xg