Fix logging in unsplash

This commit is contained in:
Hamcha 2018-04-09 15:21:25 +02:00
parent 6db07308bf
commit 8b8228c0f9
Signed by: hamcha
GPG key ID: A40413D21021EAEE

View file

@ -85,7 +85,7 @@ func unsplash(broker *tg.Broker, update tg.APIMessage) {
resp, err := http.Get(unsplashUrl)
if err != nil {
log.Println("[unsplash] HTTP request failed: %s\n", err.Error())
log.Printf("[unsplash] HTTP request failed: %s\nOriginal URL: %s\n", err.Error(), unsplashUrl)
broker.SendTextMessage(update.Chat, "<b>ERRORE!</b> @hamcha controlla la console!", &update.MessageID)
return
}
@ -93,7 +93,7 @@ func unsplash(broker *tg.Broker, update tg.APIMessage) {
img, _, err := image.Decode(resp.Body)
if err != nil {
log.Println("[unsplash] Image decode error: %s\n", err.Error())
log.Printf("[unsplash] Image decode error: %s\nOriginal URL: %s\n", err.Error(), unsplashUrl)
broker.SendTextMessage(update.Chat, "<b>ERRORE</b>: Non riesco a leggere l'immagine", &update.MessageID)
return
}