C
C# Learner
Consider:
public void PublicMethod() {
DoSomething();
DoSomethingElse();
}
void DoSomething() {
if (!TryParse(data)) {
throw new FooException();
}
}
void DoSomethingElse() {
if (!TryProcess(something)) {
throw new BarException();
}
}
How should one comment these exceptions? Should one simply comment that
PublicMethod can throw FooExceptions and BarExceptions? Should one comment
that the private methods can throw exceptions too?
public void PublicMethod() {
DoSomething();
DoSomethingElse();
}
void DoSomething() {
if (!TryParse(data)) {
throw new FooException();
}
}
void DoSomethingElse() {
if (!TryProcess(something)) {
throw new BarException();
}
}
How should one comment these exceptions? Should one simply comment that
PublicMethod can throw FooExceptions and BarExceptions? Should one comment
that the private methods can throw exceptions too?