# Class InvalidCommandException OptimaJet.Workflow.Core.Fault.InvalidCommandException Represents an exception thrown when a workflow command cannot be executed because the command input is invalid for the current runtime state. Namespace: [OptimaJet.Workflow.Core.Fault](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/) ```csharp public class InvalidCommandException : Exception, ISerializable ``` ## Type Hierarchy - [Exception](https://learn.microsoft.com/dotnet/api/system.exception) - InvalidCommandException Current type - Implemented interfaces - [ISerializable](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable) ## Constructors `public InvalidCommandException(string message, params object[] args)` Initializes a new instance of the [InvalidCommandException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/InvalidCommandException/) class using a composite-format string. ### Parameters | Name | Type | Description | | --- | --- | --- | | `message` | `String` | The composite format string that describes the failure. | | `args` | `Object[]` | The arguments to apply to `message`. | ### Remarks The final exception message is created by passing `message` and `args` to [string.Format(string, params object\[\])](https://learn.microsoft.com/dotnet/api/system.string.format#system-string-format\(system-string-system-object\(\)\)). [Previous InitialActivityNotFoundException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/InitialActivityNotFoundException/) [Next InvalidJsonParameterValueException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/InvalidJsonParameterValueException/)