0

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

user3742604
  • 97
  • 1
  • 1
  • 8
  • 1
    You can add a high level exception handler on the app domain and show your custom error box there, then end the process (`Environment.Exit`). See https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx – Ron Beyer Jun 15 '15 at 15:14

1 Answers1

0

Use Debug class, you can show errors in output line

https://msdn.microsoft.com/en-us/library/system.diagnostics.debug.writeline(v=vs.110).aspx

n1troo
  • 1
  • 2