Re: Subclass of Exception

2014-06-15 Thread FreeSlave via Digitalmars-d-learn
I don't think you always need documentation for all exception classes, since the most of them have the same interface. Usually it's worth to describe where is some exception able to be thrown from, not exception itself. And it's covered by function documentation, not by documentation of

Re: Subclass of Exception

2014-06-15 Thread Paul via Digitalmars-d-learn
On Sunday, 15 June 2014 at 09:23:36 UTC, FreeSlave wrote: I don't think you always need documentation for all exception classes, since the most of them have the same interface. Usually it's worth to describe where is some exception able to be thrown from, not exception itself. And it's covered

Re: Subclass of Exception

2014-06-14 Thread bearophile via Digitalmars-d-learn
Paul: class MyError : Exception { this(string msg) { super(msg); } } Don't call exceptions errors, because in D there are also errors, so they should have distinct names. Is any shorter D way? Perhaps not. Bye, bearophile

Re: Subclass of Exception

2014-06-14 Thread FreeSlave via Digitalmars-d-learn
On Saturday, 14 June 2014 at 11:59:53 UTC, Paul wrote: One stupid question: in Python subclassing of Exception looks like: class MyError(Exception): pass but in D, if I'm right, we should write more code: class MyError : Exception { this(string msg) { super(msg); } } (without

Re: Subclass of Exception

2014-06-14 Thread Paul via Digitalmars-d-learn
On Saturday, 14 June 2014 at 12:17:46 UTC, FreeSlave wrote: On Saturday, 14 June 2014 at 11:59:53 UTC, Paul wrote: One stupid question: in Python subclassing of Exception looks like: class MyError(Exception): pass but in D, if I'm right, we should write more code: class MyError : Exception {

Re: Subclass of Exception

2014-06-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Sat, 14 Jun 2014 11:59:52 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: One stupid question: in Python subclassing of Exception looks like: class MyError(Exception): pass but in D, if I'm right, we should write more code: class MyError : Exception {