Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyExceptionClass : Exception
- {
- public MyExceptionClass(string message, string extraInfo)
- {
- //This is where it's all falling apart
- base(message);
- }
- }
- public class MyExceptionClass : Exception
- {
- public MyExceptionClass(string message, string extrainfo) : base(message)
- {
- //other stuff here
- }
- }
- class MyExceptionClass : Exception
- {
- public MyExceptionClass(string message, string extraInfo) :
- base(ModifyMessage(message, extraInfo))
- {
- }
- private string ModifyMessage(string message, string extraInfo)
- {
- Trace.WriteLine("message was " + message);
- return message.ToLowerInvariant() + Environment.NewLine + extraInfo;
- }
- }
- // Constructor 1
- public MyExceptionClass(string message, string extraInfo) :
- this(17) // calls constructor 2
- {
- // ...
- }
- // Constructor 2
- public MyExceptionClass(int foo)
- {
- // ...
- }
- public class MyExceptionClass : Exception
- {
- public MyExceptionClass(string message,
- Exception innerException): base(message, innerException)
- {
- //other stuff here
- }
- }
Add Comment
Please, Sign In to add comment