www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20735] New: UTFException.toString does not print a stack

https://issues.dlang.org/show_bug.cgi?id=20735

          Issue ID: 20735
           Summary: UTFException.toString does not print a stack trace or
                    filename/line
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

UTFException overrides toString (without parameters), and does not override the
toString which uses the sink.

The odd result is, if you catch a UTFException, you get different behaviors
for:

writeln(e);
writeln(e.toString());

The first prints e.msg with source file and line number where the exception was
thrown, and then the stack trace.

The second prints a customized message for UTF, but no stack trace, and no
filenames or line numbers.

These should be consistent, and an exception message should be useful for
finding the source of the error (printing no file name or line number is a
terrible default behavior).

--
Apr 13 2020