Skip to content

Commit

Permalink
ValueError breaking the uploading of a folder (UsergeTeam#157)
Browse files Browse the repository at this point in the history
While uploading a folder, files greater than 2GiB is breaking the whole process.🥺

Here, Exception has been caught already, but raising the exception is the main reason of breaking the process.(I guess)

Skip the raise of ValueError may solve this. Because we can't do anything about that limit as it is being imposed by Telegram itself.
  • Loading branch information
gautamajay52 authored Sep 21, 2020
1 parent c7339cc commit e039fbf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions userge/plugins/misc/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ async def doc_upload(message: Message, path, del_path: bool = False, extra: str
progress=progress,
progress_args=(message, f"uploading {extra}", str(path.name))
)
except ValueError as e_e:
await sent.edit(f"Skipping `{path}` due to {e_e}")
except Exception as u_e:
await sent.edit(u_e)
raise u_e
Expand Down Expand Up @@ -258,6 +260,8 @@ async def vid_upload(message: Message, path, del_path: bool = False, extra: str
progress=progress,
progress_args=(message, f"uploading {extra}", str(path.name))
)
except ValueError as e_e:
await sent.edit(f"Skipping `{path}` due to {e_e}")
except Exception as u_e:
await sent.edit(u_e)
raise u_e
Expand Down Expand Up @@ -314,6 +318,8 @@ async def audio_upload(message: Message, path, del_path: bool = False, extra: st
progress=progress,
progress_args=(message, f"uploading {extra}", str(path.name))
)
except ValueError as e_e:
await sent.edit(f"Skipping `{path}` due to {e_e}")
except Exception as u_e:
await sent.edit(u_e)
raise u_e
Expand Down Expand Up @@ -343,6 +349,8 @@ async def photo_upload(message: Message, path, del_path: bool = False, extra: st
progress=progress,
progress_args=(message, f"uploading {extra}", str(path.name))
)
except ValueError as e_e:
await sent.edit(f"Skipping `{path}` due to {e_e}")
except Exception as u_e:
await sent.edit(u_e)
raise u_e
Expand Down

0 comments on commit e039fbf

Please sign in to comment.