RobotStudio event

PC SDK problem / bug in EventLogMessage object

Options
System.Text.StringBuilder sbBody = new System.Text.StringBuilder();
sbBody.AppendLine(eventLogMessage.Body);
sbBody.AppendLine(eventLogMessage.CategoryType.ToString()); //Causes an exception
                       
The CategoryType is marked obsolete, however since the obsoletion apparently is not marked as dead using the Attribute spec:
[System.Obsolete("use NewMethod", true)] //True results in compilecrash

Then it becomes a bit annoying when the attribute fires a NotSupportedException Cry

Please fix for next release, and have the courtesy of looking at some of the other obsoletes. I have run into one more somewhere.

Regards

Comments

  • Hi,
     

    the property EventLogMessage.CategoryType is marked as Obsolete.

    The odd thing is that the implementation throws a NotSupportedException.

     

    I'll try to find out the reason for this. 

     

    In many cases its better to return some "good default" value when calling the obsolete property instead of throwing an exception.

     

    Its a bit philosophic; Is it better to have an application that seems to work, and is using a value in its code, but the value is not really valid since its just some default returned from an obsolete function.

     

    Or is it better to indicate that the application is not reliable because it is trying to use a return value from an obsolete function, by throwing an exception.

     

    From your post I can guess what your choice is.

     

     

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog