Skip to content

Catch 404 if user leaves while roles are being added #1057

@MarkKoz

Description

@MarkKoz

Sentry Issue: BOT-73

We really should go over the code and handle all 404s, not just for add_roles. It could be added to the command/event error handlers, but I'm not sure if that'd be too broad.

NotFound: 404 Not Found (error code: 10007): Unknown Member
  File "discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/cogs/verification.py", line 115, in accept_command
    await ctx.author.add_roles(Object(constants.Roles.verified), reason="Accepted the rules")
  File "discord/member.py", line 641, in add_roles
    await req(guild_id, user_id, role.id, reason=reason)
  File "discord/http.py", line 223, in request
    raise NotFound(r, data)

Error executing command invoked by <REDACTED>: !accept

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: 3 - lowLow Priorityt: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions