Force sync to quit with -1 if ignore_failed_copy is set to False

sync prints an error or warning if an error occured while syncing and continue work. 
I changed it, so that it fails, if ignore_failed_copy is set to False and continue work otherwise