Discord-Scraper
Discord-Scraper copied to clipboard
Error messages showing up in multiples when scraping multiple channels per guild.
This is likely due to the fact that I haven't forced the script to swallow exceptions in the function named handleNetworkData in the main script file.
I'll keep debugging the script until I have this issue fixed on the next commit.
Okay I did discover why this is occurring and I feel pretty dumb for overlooking this...
NetworkException is a child of CustomException which is a child of Exception By the rule of inheritance, NetworkException is considered a child of Exception
So whenever I did something like this:
try:
raise NetworkException(...)
except NetworkException as nex:
stderr.write(nex.getMessage())
except Exception as ex:
raise RuntimeException(...) from ex
except RuntimeException as rex:
stderr.write(rex.getMessage())
I ended up potentially having three error messages show up per error. So the solution here is to break the inheritance between NetworkException and Exception.