The status of
command execution signals only if the command is executing,
has been completed, or been canceled. If completed, the "status" attribute
does not specify if it completed successfully or not. If a command
completes but fails, the responder MUST include at least one <note
type='error'/> with the <command status='completed'/> it
returns.
I do not believe that XEP-0050 specifies what the IQ type is (result or
error) when a command execution is completed with a failure.
As with all command results it must be type result. If it were type error
that would be an error at the iq level and have normal iq error content. It
would be an abort so no ad hoc specific content would be expected or
probably even valid with type error.
XEP-0050 Section 4.4 "Possible Errors"
defines command execution errors.
All of the descriptions listed relate to conditions where the responding
entity is prevented from starting to execute the command: it doesn't
understand the action, the requesting entity doesn't have permissions to
execute the command, and so on.
In example 23, it is shown that these type of errors are used in an IQ
type=error.
Correct. Those are iq level errors, nothing even reaches the command and the
iq itself fails.
- <conflict/> The command cannot be completed
because of a data or
system conflict (e.g., a user already exists with that username).
- No entity is allowed to perform the command (e.g., retrieve the CEO's
roster).
To me, these two are examples of what should be responded to with a
<command status='completed'><note
type='error'/></command>.
Should is a strong word. Could. Probably I would. But seems it's specified
to not which should be fine.