Skip to content

Instantly share code, notes, and snippets.

@loonison123
Created August 1, 2014 13:43
Show Gist options
  • Select an option

  • Save loonison123/bf645eb9a83aa5280285 to your computer and use it in GitHub Desktop.

Select an option

Save loonison123/bf645eb9a83aa5280285 to your computer and use it in GitHub Desktop.
Basic Custom Exception in C#
// Source: http://msdn.microsoft.com/en-us/library/vstudio/ms229064(v=vs.100).aspx
public class NewException : BaseException, ISerializable
{
public NewException() { }
public NewException(string message) { }
public NewException(string message, Exception inner) { }
// This constructor is needed for serialization.
protected NewException(SerializationInfo info, StreamingContext context) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment