Skip to content

Provide better error messages in IllegalCommandUse exceptions #47

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

Closed
virtuald opened this issue Jan 20, 2024 · 0 comments · Fixed by #52
Closed

Provide better error messages in IllegalCommandUse exceptions #47

virtuald opened this issue Jan 20, 2024 · 0 comments · Fixed by #52

Comments

@virtuald
Copy link
Member

Things like

raise IllegalCommandUse(
                f"The deadline command cannot also be in the other commands!"
            )

Are fine, but not particularly user-friendly. I understand why Java/C++ don't do the friendly thing, but we can do better. Maybe something like?

raise IllegalCommandUse("message", deadline=deadline)

And have the constructor take msg, **kwargs, and append ", ".join(f"{k}={v!r}" for k, v in kwargs.items())?

Might do in #46, we'll see.

virtuald added a commit that referenced this issue Jan 24, 2024
- While this isn't strictly compatible with Java, that's fine
- Fixes #47
virtuald added a commit that referenced this issue Jan 24, 2024
- While this isn't strictly compatible with Java, that's fine
- Fixes #47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant