Soft Throw in c# process node

Hi, imagine I have:

public Int2 Degree { get; protected set; }

// My degree must be > 0
// I can't make default degree like (1,1)
// Only specify default there witch is (0,0)
public void SetDegree(Int2 degree = default) 
{
     // so now i can do something like
     if (degree == defalut)
         Degree = new Int(2,2)

     // However if user creates IO Box 
     // he is going to pass 0,0 stright away
     // so I can do something like:
     Degree = new Int2(Math.Max(2,degree.X), Math.Max(2, degree.Y);

     // witch is going to be nice from user 
     // perspective (no error), but now
     // user passed one arg, and i use another arg
     
     // Here is the question:
     // What to do here, to notify user that there was an error?
     // But keep execution 
}

And a side note:
Is it possible somehow to specify defaults for structs, unless it’s wrapped in forward?

Can you use “warn” (yellow node)?

You can define default values for non-primitive types with the DefaultValue attribute like this:

    public static Int2 DemoNode([DefaultValue("1, 1")] Int2 foo)
    {
        return foo;
    }

Regarding warnings: You could use the logging mechanism, or like bjoern said, the IVLRuntime.AddPersistentMessage method as for example seen here.

Wait, was this a beta question? (You opened this thread in the beta forum).

Opsy, it’s a gamma

Ah can’t believe it actually exists!