~nova/fletcher#126: 
When a user submits a command which fails with a connection error, react with 🔌 instead of 🚫

When a user submits a command which fails with any type of connection error, react with 🔌 instead of 🚫, which might make the debugging easier, but more importantly is very cute, so from that standpoint it's a feature request.

Overall I would be a big fan of reacting with various emojis depending on what went wrong (or right, if there are multiple possible ways to succeed for a command).

Status
REPORTED
Submitter
~velizar
Assigned to
No-one
Submitted
4 years ago
Updated
4 years ago
Labels
Feature Request

~velizar 4 years ago

After looking at the source code, I think that this might not be plausible for the !stylish command, because it's very plausible that the endpoint being called returns 500 instead of 503 or 504, and you don't want to handle 500 with 🔌, you want 🚫 or something, so it also depends on the backend for that command returning the precise status code. But in theory, the fix would be something like this (this should work for the aiohttp library):

except (HTTPServiceUnavailable, HTTPGatewayTimeout) as e:
    exc_type, exc_obj, exc_tb = exc_info()
    logger.error("STF[{}]: {} {}".format(exc_tb.tb_lineno, type(e).__name__, e))
    await message.add_reaction("🔌")```
Register here or Log in to comment, or comment via email.