If setter encounters invalid argument, your option is not to write to the console, since that won't provide any information to the caller. You should throw an exception in that case.
Something like this:
public double SetWidth
{
get
{
return Width;
}
set
{
if (value > 10)
{
throw new ArgumentOutOfRangeException("There is some Bad Input.");
}
else
{
Width = value;
}
}
}
On the caller side you need try-catch blocks to intercept this.
An other note based on SA's catch: in the setter you need to validate the new
value
, not the stored one.