Rule of thumb is to avoid throwing System.Exception or System.ApplicationException. I created a custom exception (below) which inherits from Exception.
Implement standard exception constructors
Types should not extend certain base types
[Serializable]
public class MyCustomException : System.Exception
{
public MyCustomException(){}
public MyCustomException (string message) : base (message) {}
public MyCustomException (string message, Exception innerException) :
base(message, innerException){}
protected ProcessorException(SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
Implement standard exception constructors
Types should not extend certain base types
[Serializable]
public class MyCustomException : System.Exception
{
public MyCustomException(){}
public MyCustomException (string message) : base (message) {}
public MyCustomException (string message, Exception innerException) :
base(message, innerException){}
protected ProcessorException(SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
Comments