More exception classes into Phobos?
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Sat Mar 25 06:54:24 PDT 2017
On 2017-03-24 20:38, H. S. Teoh via Digitalmars-d wrote:
> It's already kind enough on my part to actually
> want to use std.format to produce a message that a human reader might
> find helpful, like "syntax error on line 36: unexpected character 'x'".
> I could have just done a `throw new Exception("syntax error");` and be
> done with it. At least I, the human, would read that message if the
> Exception got thrown, but put in additional effort so that it's
> parseable by code? No thanks.
If it's a specific exception type with a specific field for the line
number and a field for a filename (if applicable) then it can be used in
a text editor to navigate to that file and highlight the line.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list