https://issues.dlang.org/show_bug.cgi?id=13543
--- Comment #5 from [email protected] --- (In reply to bearophile_hugs from comment #3) > If I open a file, and the opening fails, I'd like the > exception to tell me what damned line of my code has tried to open that > file. - - - - - - - - - - - - - - - A Python script (both files are missing): f1 = open("some_file1.txt") f2 = open("some_file2.txt") Gives information that helps to locate what's the line that has tried to open the missing file: Traceback (most recent call last): File "...\test.py", line 1, in <module> f1 = open("some_file1.txt") IOError: [Errno 2] No such file or directory: 'some_file1.txt' - - - - - - - - - - - - - - - A similar D program gives line number inside the library code, but I'd like an exception that tells me that the problem is in test.d at line 3: void main() { import std.stdio; auto f1 = File("some_file1.txt"); auto f2 = File("some_file2.txt"); } std.exception.ErrnoException@std\stdio.d(364): Cannot open file `some_file1.txt' in mode `rb' (No such file or directory) ---------------- 0x0040447B in @safe shared(core.stdc.stdio._iobuf)* std.exception.__T12errnoEnforceTPOS4core4stdc5stdio6_iobufVAyaa11_7374645c737464696f2e64Vki364Z.errnoEnforce(shared(core.stdc.stdio._iobuf)*, lazy immutable(char)[]) ... - - - - - - - - - - - - - - - --
