Bug 20735 – UTFException.toString does not print a stack trace or filename/line

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2020-04-14T06:06:42Z
Last change time
2024-12-01T16:36:36Z
Assigned to
No Owner
Creator
Steven Schveighoffer
Moved to GitHub: phobos#10413 →

Comments

Comment #0 by schveiguy — 2020-04-14T06:06:42Z
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).
Comment #1 by robert.schadek — 2024-12-01T16:36:36Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10413 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB