FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link

uncaught exception Reddit returned a 404 for user history #31

Closed OmgImAlexis closed 2 years ago

OmgImAlexis commented 2 years ago
2021-10-20T22:43:49+00:00 warn   : ~u/username~ {r/subreddit} [COM ID] [CHK low xp comment spam] Running rules failed due to uncaught exception Reddit returned a 404 for user history. Likely this user is shadowbanned.
SimpleError: Reddit returned a 404 for user history. Likely this user is shadowbanned.
    at Object.getAuthorActivities (CWD/src/Utils/SnoowrapUtils.js:92:19)
    at async cacheVal.cache.wrap.ttl (CWD/src/Subreddit/SubredditResources.js:340:24)
FoxxMD commented 2 years ago

This is normal! Can't run rules that depend on user history if the user history isn't available. The exception is caught (and logged) -- running checks for the activity just ends early since we can't be sure if this check would trigger or not because of the lack of history.

I could prevent it from printing a stacktrace if its confusing whether this is handled or not.

FoxxMD commented 2 years ago

Newer versions of CM now include "blameable" stack traces which show "caused by" traces so, while this will still produce a stack trace, it should be easier to understand what happened and why it happened. Also, it should still be an error since the event/rule didn't run due to the history 404 being "unexpected", IMO.

going to close this for now, if you think I should change the behavior we can re-open it and discuss.