So I am fairly new to C#, and I've been learning by translating my code from python to C#. Now the problem I've stumbled upon, is: how do i catch the CS7036 error. It's called an "AttributeError" in python, and it happens, if you try to instantiate a class, without the required amount of arguments.
public Vector Crossproduct(Vector other)
{
try
{
List<double> output = new List<double>()
{
Y* other.Z - other.Y * Z,0 - (X * other.Z- other.X * Z),X* other.Y - other.X * Y
};
Vector outputvector = new Vector(output);
return outputvector;
}
catch (Exception)
{
throw;
}
}
I've Googled this and found that there is almost nothing on this error. Here's a link to Microsoft's documentation for C#.Here and here.
My problem is not how to fix the error, but how to catch it, just so I'm clear.