From 56d4949f66c27eeec936c4d9eed21ebd01be3318 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Thu, 9 Apr 2020 20:57:48 +0200 Subject: [PATCH] Properly return err on error --- download.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/download.go b/download.go index 92f1649..ffba264 100644 --- a/download.go +++ b/download.go @@ -43,12 +43,14 @@ func decodeVideoStream(videoUrl, format string) error { res, err := goutubedl.New(context.Background(), videoUrl, goutubedl.Options{}) if err != nil { logrus.Errorf("Unable to create goutube object %s: %v", videoUrl, err) + return err } file := removeWhiteSpace(res.Info.Title) + fixExtension(format) videoStream, err := res.Download(context.Background(), "best") if err != nil { logrus.Errorf("Unable to download %s stream: %v", format, err) + return err } defer videoStream.Close()