From 9c2bfcf7d87e8873221daa78ae586a5ab6423b8d Mon Sep 17 00:00:00 2001 From: Ade Date: Mon, 28 Aug 2017 20:54:19 +1200 Subject: [PATCH] Scan Artist exception handling --- headphones/webserve.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/headphones/webserve.py b/headphones/webserve.py index 6d95712a..f1fbbfbe 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -353,9 +353,13 @@ class WebInterface(object): if not os.path.isdir(artistfolder.encode(headphones.SYS_ENCODING)): logger.debug("Cannot find directory: " + artistfolder) continue - threading.Thread(target=librarysync.libraryScan, - kwargs={"dir": artistfolder, "artistScan": True, "ArtistID": ArtistID, - "ArtistName": artist_name}).start() + try: + threading.Thread(target=librarysync.libraryScan, + kwargs={"dir": artistfolder, "artistScan": True, "ArtistID": ArtistID, + "ArtistName": artist_name}).start() + except Exception as e: + logger.error('Unable to complete the scan: %s' % e) + raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % ArtistID) @cherrypy.expose