C# and custom errors.
I know there is an option to create my own errors in c++.
I'd like to know if it can be done also in c#. [smile]
I've always created them by creating a custom class that's derived from the System.ApplicationException class, and then using the command:
"throw new custom_error_name()"
Dave
"throw new custom_error_name()"
Dave
public class MyError : System.Exception { MyError() : base( "Unspecified error" ) {} MyError( string n ) : base( n ) {} MyError( string n, System.Exception inner ) : base( n, inner ) {}}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement