public SendCommandResult(SendCommandResultType type, Exception exception)
 {
     if (exception == null) throw new ArgumentNullException(nameof(exception));
     if (!Enum.IsDefined(typeof (SendCommandResultType), type))
         throw new ArgumentOutOfRangeException(nameof(type));
     if (type.IsNotOneOf(SendCommandResultType.ProcessingError, SendCommandResultType.PersistenceFailed)) throw new ArgumentOutOfRangeException(nameof(type));
     Type = type;
     Exception = exception;
 }