admin@glassfish.java.net

Re: exit code of command

From: Byron Nevins <byron.nevins_at_oracle.com>
Date: Mon, 20 Jun 2011 21:53:27 -0700

Generally -- it is on a case-by-case basis.

A general rule is to usually make the "enclosing" command an official
warning if any sub-commands are warnings. Since the whole point is to
give some extra info to the user.

Example:
You deploy to a cluster.
The cluster is not running
The deploy succeeded but it's worth mentioning to the user that no
instance in the cluster happens to be running. I.e. a "warning".

If the sub-commands fail -- it depends on the enclosing command. Maybe
it's an error, maybe not.

On 6/20/2011 6:09 PM, Anissa Lam wrote:
>
> I have a question regarding the exit code of the actionReport that we
> get back from a command.
> If there are sub-reports, and one of the sub-report has exit_code
> of "WARNING", what should the exit_code of this command be ?
> Should the exit_code of the report be "SUCCESS" since the command has
> succeeded or it should be "WARNING" to indicate the command
> succeeded with warning ?
> And how about the case where one sub-report has "FAILURE" and another
> sub-report has "WARNING" ?
>
> thanks
> Anissa.
>
>
>

-- 
Oracle <http://www.oracle.com>
Byron Nevins | Principal MTS
Phone: +1 6503958992 <tel:+1%206503958992>
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment