add generic exceptions

This commit is contained in:
Louis Abel 2022-07-05 00:26:49 -07:00
parent 138d1076f5
commit 3aa640ec45
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36

View File

@ -1060,6 +1060,7 @@ class RepoSync:
) )
if not os.path.exists(os_tree_path): if not os.path.exists(os_tree_path):
try:
Shared.treeinfo_new_write( Shared.treeinfo_new_write(
os_tree_path, os_tree_path,
self.distname, self.distname,
@ -1069,6 +1070,8 @@ class RepoSync:
int(self.timestamp), int(self.timestamp),
repo_name repo_name
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1076,12 +1079,15 @@ class RepoSync:
) )
if not os.path.exists(os_disc_path): if not os.path.exists(os_disc_path):
try:
Shared.discinfo_write( Shared.discinfo_write(
self.timestamp, self.timestamp,
self.fullname, self.fullname,
a, a,
os_disc_path os_disc_path
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1089,11 +1095,14 @@ class RepoSync:
) )
if not os.path.exists(os_media_path): if not os.path.exists(os_media_path):
try:
Shared.media_repo_write( Shared.media_repo_write(
self.timestamp, self.timestamp,
self.fullname, self.fullname,
os_media_path os_media_path
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1123,6 +1132,7 @@ class RepoSync:
) )
if not os.path.exists(debug_tree_path): if not os.path.exists(debug_tree_path):
try:
Shared.treeinfo_new_write( Shared.treeinfo_new_write(
debug_tree_path, debug_tree_path,
self.distname, self.distname,
@ -1132,6 +1142,8 @@ class RepoSync:
self.timestamp, self.timestamp,
repo_name repo_name
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1139,12 +1151,15 @@ class RepoSync:
) )
if not os.path.exists(debug_disc_path): if not os.path.exists(debug_disc_path):
try:
Shared.discinfo_write( Shared.discinfo_write(
self.timestamp, self.timestamp,
self.fullname, self.fullname,
a, a,
debug_disc_path debug_disc_path
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1152,11 +1167,14 @@ class RepoSync:
) )
if not os.path.exists(debug_media_path): if not os.path.exists(debug_media_path):
try:
Shared.media_repo_write( Shared.media_repo_write(
self.timestamp, self.timestamp,
self.fullname, self.fullname,
debug_media_path debug_media_path
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1184,6 +1202,7 @@ class RepoSync:
) )
if not os.path.exists(source_tree_path): if not os.path.exists(source_tree_path):
try:
Shared.treeinfo_new_write( Shared.treeinfo_new_write(
source_tree_path, source_tree_path,
self.distname, self.distname,
@ -1193,6 +1212,8 @@ class RepoSync:
self.timestamp, self.timestamp,
repo_name repo_name
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1200,12 +1221,15 @@ class RepoSync:
) )
if not os.path.exists(source_disc_path): if not os.path.exists(source_disc_path):
try:
Shared.discinfo_write( Shared.discinfo_write(
self.timestamp, self.timestamp,
self.fullname, self.fullname,
'src', 'src',
source_disc_path source_disc_path
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
@ -1213,11 +1237,14 @@ class RepoSync:
) )
if not os.path.exists(source_media_path): if not os.path.exists(source_media_path):
try:
Shared.media_repo_write( Shared.media_repo_write(
self.timestamp, self.timestamp,
self.fullname, self.fullname,
source_media_path source_media_path
) )
except Exception as e:
print(e)
else: else:
self.log.warn( self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +