I'm producing a prototype system that will need to throw well-explained exceptions in order to make it a bit more user-friendly. The thing is, being as this system is undergoing development, I don't want to spend a lot of time creating exception classes until I've implemented the system and I know it works! Therefore, I'm thinking along the lines of creating a sort of "dummy" exception class that shows a compiler warning wherever it's thrown, reminding me to replace it with a more meaningful exception later.
public sealed class DummyException
{
public DummyException() : base()
{
// How do I generate a compiler warning which will display once for each
// instance that this code is called?
}
}
I know I can use a TODO
comment in each instance, but I'd rather use my proposed method so that I'll always get the warning whenever I use the dummy exception (rather than relying on me to remember to put a "TODO" comment on every thrown exception). Is this possible, and if so, how do I do it?