[jboss-jira] [JBoss JIRA] (WFCORE-1902) Error messages from CLI batch should be more informative

Jean-Francois Denise (JIRA) issues at jboss.org
Thu Oct 27 09:56:00 EDT 2016


    [ https://issues.jboss.org/browse/WFCORE-1902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13313040#comment-13313040 ] 

Jean-Francois Denise commented on WFCORE-1902:
----------------------------------------------

Hi Marek,
helping user to identify the source of an error is definitely helpful.
I guess that you want to help user mainly when a batch is located inside script.

- Adding the command (or operation) that was failing in addition to the step number could be helpful. This could be helpful both in interactive and inside a script.

- Script line number. There is no support for script line number today. To match a script line to its output, you can use the --echo-command option. Every command will be printed prior to be executed. That should already help user with large scripts.

Step line inside a script are not that easy to retrieve due to multi-line support. For example:
batch
:read-attribute(\
name=name)
:read-attribute(\
name=nonsence)
run-batch

Line of failing run-batch is 6, what is the line of failing step-2?

This could be implemented in the CLI today and/or in the CLI.next. I personally like the idea. I am surprised that no customer already required it.

> Error messages from CLI batch should be more informative
> --------------------------------------------------------
>
>                 Key: WFCORE-1902
>                 URL: https://issues.jboss.org/browse/WFCORE-1902
>             Project: WildFly Core
>          Issue Type: Feature Request
>          Components: CLI
>    Affects Versions: 3.0.0.Alpha10
>            Reporter: Marek Kopecký
>            Assignee: Jean-Francois Denise
>
> *Description of problem:*
> Error messages from CLI batch should be more informative
> *Steps to Reproduce:*
> {noformat}
> cat <<EOF >a
> batch
> :read-attribute(name=product-version)
> :read-attribute(name=product-name)
> :read-attribute(name=nonsence)
> :read-attribute(name=product-name)
> run-batch
> EOF
> ./jboss-cli.sh -c --file=a
> {noformat}
> *Actual results:*
> {noformat}
> The batch failed with the following error (you are remaining in the batch editing mode to have a chance to correct the error): {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-3" => "WFLYCTL0201: Unknown attribute 'nonsence'"}}
> {noformat}
> *Expected results:*
> I can imagine content like following could be helpful for troubleshooting:
> {noformat}
> {
>    "WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {
>       "Operation step-3" => {
>          "line number" => 4
>          "operation" => ":read-attribute(name=nonsence)"
>          "response" => "WFLYCTL0201: Unknown attribute 'nonsence'"
>    }
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.2.2#72004)



More information about the jboss-jira mailing list