From 6f57c192909f5d846afba746c6e017feaa796803 Mon Sep 17 00:00:00 2001 From: evilhero Date: Wed, 4 Apr 2018 14:26:39 -0400 Subject: [PATCH] FIX: corrected exception catch for post-processing move/copy failures so that it logs from correct location --- mylar/helpers.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mylar/helpers.py b/mylar/helpers.py index 4fe54b63..5d8a1fac 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -3716,7 +3716,8 @@ def file_ops(path,dst,arc=False,one_off=False): try: shutil.copy( path , dst ) # if crc_check == mylar.filechecker.crc(dst): - except: + except Exception as e: + logger.error('[%s] error : %s' % (action_op, e)) return False return True @@ -3724,7 +3725,8 @@ def file_ops(path,dst,arc=False,one_off=False): try: shutil.move( path , dst ) # if crc_check == mylar.filechecker.crc(dst): - except: + except Exception as e: + logger.error('[MOVE] error : %s' % e) return False return True @@ -3749,7 +3751,8 @@ def file_ops(path,dst,arc=False,one_off=False): shutil.copy( path, dst ) logger.fdebug('Successfully copied file to : ' + dst) return True - except: + except Exception as e: + logger.error('[COPY] error : %s' % e) return False else: logger.warn('[' + str(e) + '] Hardlinking failure. Could not create hardlink - Intervention is required if you wish to continue using hardlinks.') @@ -3784,7 +3787,8 @@ def file_ops(path,dst,arc=False,one_off=False): try: shutil.copy( dst, path ) logger.fdebug('Successfully copied file [' + dst + ' --> ' + path + ']') - except: + except Exception as e: + logger.error('[COPY] error : %s' % e) return False return True