diff --git a/fasturl/url.go b/fasturl/url.go index 6ec4e28..104bd2b 100644 --- a/fasturl/url.go +++ b/fasturl/url.go @@ -33,6 +33,8 @@ var Schemes = [SchemeCount]string { "https", } +var ErrUnknownScheme = errors.New("unknown protocol scheme") + // Error reports an error and the operation and URL that caused it. type Error struct { Op string @@ -353,7 +355,7 @@ func getscheme(rawurl string) (scheme Scheme, path string, err error) { case "https": scheme = SchemeHTTPS default: - return SchemeInvalid, "", errors.New("unknown protocol scheme") + return SchemeInvalid, "", ErrUnknownScheme } path = rawurl[i+1:] diff --git a/main.go b/main.go index 9285d56..dc070e2 100644 --- a/main.go +++ b/main.go @@ -62,6 +62,11 @@ func cmdBase(clic *cli.Context) error { case <-ticker.C: t, err := FetchTask() if err != nil { + if err == fasturl.ErrUnknownScheme { + // Not an error + err = nil + continue + } logrus.WithError(err). Error("Failed getting new task") time.Sleep(30 * time.Second)