Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The paginator should properly handle too long lines #1366

Closed
sentry-io bot opened this issue Jan 18, 2021 · 3 comments
Closed

The paginator should properly handle too long lines #1366

sentry-io bot opened this issue Jan 18, 2021 · 3 comments
Labels
a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 2 - normal Normal Priority t: bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Jan 18, 2021

We often have some features feeding too long lines to the paginator, leading to a cryptic RuntimeError. The paginator should properly handle those.

Here is a Sentry issue showing this error from the !raw command.
Sentry Issue: BOT-KV

RuntimeError: Line exceeds maximum page size 1992
  File "discord/ext/commands/help.py", line 127, in add_line
    raise RuntimeError('Line exceeds maximum page size %s' % (max_page_size))
  File "bot/exts/info/information.py", line 440, in add_content
    paginator.add_line(content.replace('```', '`` `'))
  File "bot/exts/info/information.py", line 456, in raw
    add_content(title, transformer(item))
  File "discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)

Error executing command invoked by [REDACTED]: !raw https://discord.com/channels/267624335836053506/267659945086812160/800737804496666665
@Akarys42 Akarys42 added a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 3 - low Low Priority t: bug Something isn't working labels Jan 18, 2021
@SebastiaanZ
Copy link
Member

Rather than patching each feature that tries to use the line paginator, I think it's a much better idea to make the paginator handle such inputs gracefully.

@Akarys42 Akarys42 changed the title !raw doesn't properly handle long messages The paginator should properly handle too long lines Jan 18, 2021
@Akarys42 Akarys42 added p: 2 - normal Normal Priority and removed p: 3 - low Low Priority labels Jan 18, 2021
@Den4200
Copy link
Member

Den4200 commented Jan 19, 2021

Duplicate of #1037

@Den4200 Den4200 marked this as a duplicate of #1037 Jan 19, 2021
@MarkKoz
Copy link
Member

MarkKoz commented Apr 14, 2021

This is using the default paginator rather than our LinePaginator, which does properly handle lines that are too long. As mentioned, this is a duplicate anyway, so I'm closing it.

@MarkKoz MarkKoz closed this as completed Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 2 - normal Normal Priority t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants