From 8959393defa68f7f2894b3125fb29fc62a8198e4 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Thu, 24 May 2018 22:03:54 -0400 Subject: [PATCH] improve continuos self sync fix bug in error handling while deleting videos refactoring of code --- sources/youtubeVideo.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/youtubeVideo.go b/sources/youtubeVideo.go index e4665b6..90bb046 100644 --- a/sources/youtubeVideo.go +++ b/sources/youtubeVideo.go @@ -210,10 +210,11 @@ func (v YoutubeVideo) Sync(daemon *jsonrpc.Client, claimAddress string, amount f err = v.publish(daemon, claimAddress, amount, channelName) //delete the video in all cases - if v.delete() != nil { + dErr := v.delete() + if dErr != nil { // the video was published anyway so it should be marked as published // for that to happen, no errors should be returned any further than here - log.Debugln(errors.Prefix("delete error", err)) + log.Debugln(errors.Prefix("delete error", dErr)) } if err != nil { return errors.Prefix("publish error", err)