The variable 'MyException' is declared but never used

前端 未结 6 1951
迷失自我
迷失自我 2020-12-05 09:36

I need to clear this warning :

try
{
    doSomething()
}
catch (AmbiguousMatchException MyException)
{
    doSomethingElse()
}

The complier

6条回答
  •  無奈伤痛
    2020-12-05 10:05

    You could write the exception out to a log if you've got one running. Might be useful for tracking down any problems.

    Log.Write("AmbiguousMatchException: {0}", MyException.Message);
    

提交回复
热议问题