I am throwing the ArgumentOutOfRangeException in my code as shown below
throw new ArgumentOutOfRangeException("value", "Value must be > 0");
my catch block is below
catch(ArgumentOutOfRangeException exception)
{
MessageBox.Show(exception.Message,"Input Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
} // end catch
My question is the message box shows both my custom error of "Value must be
> 0. and paramamter name=value. Why is it displaying parameter name when all
I am requesting is the exception.Message? Thanks for your help.
|