From d860c2a2b4d4e118c6f9aabcd4490709bdf22754 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 17 Oct 2016 14:25:36 -0400 Subject: [PATCH] make publish fail when given an invalid file otherwise a less obvious error is returned in lbrynet_daemon.Publisher.Publisher._show_publish_error --- lbrynet/lbrynet_daemon/Daemon.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 86d5ff3ca..e874e7b06 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -2010,11 +2010,16 @@ class Daemon(jsonrpc.JSONRPC): metadata = Metadata(p['metadata']) make_lbry_file = False sd_hash = metadata['sources']['lbry_sd_hash'] + log.info("Update publish for %s using existing stream", name) except ValidationError: make_lbry_file = True sd_hash = None metadata = p['metadata'] file_path = p['file_path'] + if not file_path: + return defer.fail(Exception("No file given to publish")) + if not os.path.isfile(file_path): + return defer.fail(Exception("Specified file for publish doesnt exist: %s" % str(file_path))) if not self.pending_claim_checker.running: self.pending_claim_checker.start(30)