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

better error message for rpad/lpad with zero-width padding #56488

Merged
merged 6 commits into from
Nov 9, 2024

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented Nov 7, 2024

Closes #45339 — throw a more informative ArgumentError message from rpad and lpad if a zero-textwidth padding is passed (not a DivideError).

If the padding character has ncodeunits == 1, suggests that maybe they want str * pad^max(0, npad - ncodeunits(str)) instead.

@stevengj stevengj added strings "Strings!" error messages Better, more actionable error messages labels Nov 7, 2024
@giordano giordano merged commit ecfd1a0 into master Nov 9, 2024
7 of 9 checks passed
@giordano giordano deleted the stevengj-patch-6 branch November 9, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages strings "Strings!"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpad throws DivideError when using zero-width padding
3 participants