Skip to content

Commit

Permalink
UploadStatus: Handle exception ZeroDivisionError
Browse files Browse the repository at this point in the history
  • Loading branch information
lzzy12 authored Feb 5, 2020
1 parent 0546819 commit 96e623e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bot/helper/mirror_utils/status_utils/upload_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def name(self):
return self.obj.name

def progress_raw(self):
return self.obj.uploaded_bytes / self.__size * 100
try:
return self.obj.uploaded_bytes / self.__size * 100
except ZeroDivisionError:
return 0

def progress(self):
return f'{round(self.progress_raw(), 2)}%'
Expand Down

0 comments on commit 96e623e

Please sign in to comment.