Tuesday, April 27, 2010

Creating custom .NET Exceptions in C#

public class XyzlException : Exception
{
public XyzlException (string errorMessage, Exception inner) : base(errorMessage, inner)
{}
}


You can pass in a custom error message to your new Exception type.

Just try it out...

No comments: