Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 3bf9e48

Browse files
committed
Exceptions need explicitly converted to strings when logging
1 parent 5894509 commit 3bf9e48

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

InfiniDrive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def print_ascii_logo():
159159
debug_log.write("Old Name: " + str(sys.argv[2]) + "\n")
160160
debug_log.write("New Name: " + str(sys.argv[3]) + "\n")
161161
debug_log.write("Error:\n")
162-
debug_log.write(e + "\n")
162+
debug_log.write(str(e) + "\n")
163163
print('An error occurred. Please report this issue on the InfiniDrive GitHub issue tracker and upload your "log.txt" file.')
164164
print('File rename failed.')
165165
elif len(sys.argv) == 4 and str(sys.argv[1]) == "download":
@@ -184,7 +184,7 @@ def print_ascii_logo():
184184
debug_log.write("----------------------------------------\n")
185185
debug_log.write("Fragment download failure\n")
186186
debug_log.write("Error:\n")
187-
debug_log.write(e + "\n")
187+
debug_log.write(str(e) + "\n")
188188
print('An error occurred. Please report this issue on the InfiniDrive GitHub issue tracker and upload your "log.txt" file.')
189189
continue
190190
pixelVals = [j for i in pixelVals for j in i]

libs/uploadHandler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def handle_upload_fragment(driveAPI, fileBytes, driveConnect, dirId, docNum, deb
3535
debug_log.write("----------------------------------------\n")
3636
debug_log.write("Fragment upload failure\n")
3737
debug_log.write("Error:\n")
38-
debug_log.write(e + "\n")
38+
debug_log.write(str(e) + "\n")
3939
print('An error occurred. Please report this issue on the InfiniDrive GitHub issue tracker and upload your "log.txt" file.')
4040

4141
time.sleep(10) # Sleep for 10 seconds before checking for upload. This should hopefully prevent a race condition in which duplicates still occur.
@@ -49,7 +49,7 @@ def handle_upload_fragment(driveAPI, fileBytes, driveConnect, dirId, docNum, deb
4949
# If querying for the last uploaded file fails, try again.
5050
debug_log.write(" Nested failure - failure to query for last uploaded file\n")
5151
debug_log.write(" Error:\n")
52-
debug_log.write(" " + e + "\n")
52+
debug_log.write(" " + str(e) + "\n")
5353
continue
5454

5555
if last_file == None or last_file['name'] != str(docNum):
@@ -66,7 +66,7 @@ def handle_upload_fragment(driveAPI, fileBytes, driveConnect, dirId, docNum, deb
6666
except Exception as e:
6767
debug_log.write(" Nested failure - failure to delete corrupted bad upload\n")
6868
debug_log.write(" Error:\n")
69-
debug_log.write(" " + e + "\n")
69+
debug_log.write(" " + str(e) + "\n")
7070
continue
7171
break
7272
continue

0 commit comments

Comments
 (0)