How to not show "unspecified error" when throwing exception

时间:2015-06-15 15:06:02

标签: c# exception silent unspecified

Somewhere in my code I want to throw an exception to stop its execution( as the possible error in question is deep in the stack). However, when I write`

throw new ArgumentException(
                    String.Format("There is a input error at X position. Execution will stop.");

I get a messageBox saying "unspecified error", and then the message. How can I make it so that "unspecified error" doesn't show? Making this messagebox not appear would also work, as I could replace it with a custom one... `

1 个答案:

答案 0 :(得分:0)