Skip to content

Drop automatic message prefix from command errors#384

Merged
alecthomas merged 2 commits into
alecthomas:masterfrom
jotaen:drop-error-prefix
Oct 7, 2023
Merged

Drop automatic message prefix from command errors#384
alecthomas merged 2 commits into
alecthomas:masterfrom
jotaen:drop-error-prefix

Conversation

@jotaen

@jotaen jotaen commented Oct 7, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
@jotaen jotaen deleted the drop-error-prefix branch October 7, 2023 07:18
@jotaen

jotaen commented Oct 7, 2023

Copy link
Copy Markdown
Contributor Author

Do you plan on cutting a release anytime soon? 😊

@jotaen

jotaen commented Oct 7, 2023

Copy link
Copy Markdown
Contributor Author

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