all repos — navani @ f2a4424f62c16474a01d8313cff63d0aa9e9e8fc

forlater's primary mail processing service

Log when no URLs are found
Anirudh Oppiliappan x@icyphox.sh
Thu, 16 Sep 2021 21:34:11 +0530
commit

f2a4424f62c16474a01d8313cff63d0aa9e9e8fc

parent

4c31ab587f36ba632ad0a08393ecd92227d19e0e

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M main.gomain.go

@@ -20,7 +20,11 @@ if err != nil {

log.Println(err) } - for _, u := range distinct(mail.ExtractURLs(body)) { + urls := mail.ExtractURLs(body) + if len(urls) == 0 { + log.Printf("no urls found") + } + for _, u := range distinct(urls) { log.Printf("url: %s\n", u) parsedURL, err := url.Parse(u) if err != nil {