[Issue 20735] New: UTFException.toString does not print a stack trace or filename/line

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 14 06:06:42 UTC 2020


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 at puremagic.com
          Reporter: schveiguy at 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).

--


More information about the Digitalmars-d-bugs mailing list