BHoM / BHoM_Adapter

GNU Lesser General Public License v3.0
7 stars 5 forks source link

Add `RecordError` saying "not implemented" to the default Execute action #207

Closed alelom closed 1 year ago

alelom commented 4 years ago

Description:

As title. So people do not need to override the Execute only to say "not implemented".

This:

public virtual Output<List<object>, bool> Execute(IExecuteCommand command, ActionConfig actionConfig = null)
{
      return new Output<List<object>, bool> { Item1 = null, Item2 = false};
}

should become

public virtual Output<List<object>, bool> Execute(IExecuteCommand command, ActionConfig actionConfig = null)
{
     BH.Engine.Reflection.Compute.RecordError($"Execute is not implemented in {this.GetType().Name}.");

     return new Output<List<object>, bool> { Item1 = null, Item2 = false};
}