简体   繁体   中英

How to not show “unspecified error” when throwing exception

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... `

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM