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

Drop automatic message prefix from command errors #384

Merged
merged 2 commits into from
Oct 7, 2023

Conversation

jotaen
Copy link
Contributor

@jotaen jotaen commented Oct 7, 2023

Resolves #383.

With this PR, kong will pass through error messages from commands’ Run() methods as is, without wrapping them up or reformatting them.

The callMethod is obsolete now, its only purpose was the error wrapping. The callers can use callFunction directly.

@alecthomas
Copy link
Owner

Ah I remember what the intent of this was now - it was to put the command name in the error message. So eg. if you had foo cmd the error would be prefixed with cmd: ....

@alecthomas alecthomas merged commit 93d31e1 into alecthomas:master Oct 7, 2023
2 checks passed
@jotaen jotaen deleted the drop-error-prefix branch October 7, 2023 07:18
@jotaen
Copy link
Contributor Author

jotaen commented Oct 7, 2023

Do you plan on cutting a release anytime soon? 😊

@jotaen
Copy link
Contributor Author

jotaen commented Oct 7, 2023

Ah I remember what the intent of this was now - it was to put the command name in the error message. So eg. if you had foo cmd the error would be prefixed with cmd: ....

Ah okay! I think I’d personally still prefer for the error message to be unmodified, though, as that would give more control to the application in regards to how to error messages are displayed.

livingsilver94 added a commit to livingsilver94/backee that referenced this pull request Nov 26, 2023
Kong v0.8.1 includes alecthomas/kong#384 which
fixes the issue.
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 this pull request may close these issues.

Drop automatic prefix in error messages returned by Run()?
2 participants