mojidev-py / discmoji

A discord API wrapper made for fun
MIT License
4 stars 1 forks source link

Ratelimit Warning is blocking #11

Closed XenonPy closed 1 month ago

XenonPy commented 1 month ago

What I mean by this is that because you're calling it with raise, it stops the program. We need to use warnings.warn()

self-assigned this, currently working on it

XenonPy commented 1 month ago

Fixed with PR.

ghost commented 1 month ago

you can use the Exception object catched by the except statement and have it processed by your warning.warn() or warning.error() method, whichever :

try:
  raise NotImplemented("test")
except Exception as error:
  warning.error(error)
XenonPy commented 1 month ago

@almostDemoPy This seems more pythonic, could you fork this and make the changes (if you have time im really busy rn)? I can make a PR

ghost commented 1 month ago

@XenonPy regards this, you can take a look at my library's own logging module. Logger.error() requires an Exception object passed as parameter

i'm not home rn so can't do anything yet