Bug #4383
closedNeed to provide users with more details on failures or errors that occur when executing a command.
Description
Unless I am mistaken, there is not currently a way to provide users with details on the true failure of a command.
For example, when a developer creates a new command, they have the ability to provide something like the following:
failure_message "Could not update the filter rule"
Unfortunately, this doesn't give enough detail to the user to address the failure. More information is, however, typically available in the response received from the server. If possible, we should expose some of those details to the user.
For example, the response from the server, might be:
Completed 422 Unprocessable Entity in 685.1ms (Views: 0.8ms | ActiveRecord: 152.3ms)
With body: {"displayMessage":"Validation failed: Invalid filter rule specified, 'version' cannot be specified in the same tuple as 'min_version' or 'max_version'","errors":{"base":["Invalid filter rule specified, 'version' cannot be specified in the same tuple as 'min_version' or 'max_version'"]}}
Updated by Tomáš Strachota almost 11 years ago
Brad, this is already possible. Katello plugin is only missing it's own exception handler. I've added it in this commit
https://github.com/tstrachota/hammer-cli-katello/commit/606ed21867751d7c9cf9fdb518ca39f89f03fc50
but it still waits in a PR.
There's a bit more on exception handlers here https://github.com/theforeman/hammer-cli/blob/master/doc/creating_commands.md#exception-handling
Let me know if you have more questions.
Updated by Tomáš Strachota almost 11 years ago
- Related to Bug #4504: hammer-cli-katello needs own exception handler added
Updated by Tomáš Strachota almost 11 years ago
- Status changed from New to Closed
Moved to katello cli as:
http://projects.theforeman.org/issues/4504