Why the hell do exceptions give error in the library rather than the user code?

Josphe Brigmo JospheBrigmo at gmail.com
Fri Sep 14 16:40:01 UTC 2018


On Friday, 14 September 2018 at 15:40:46 UTC, Jonathan Marler 
wrote:
> On Friday, 14 September 2018 at 14:34:36 UTC, Josphe Brigmo 
> wrote:
>> std.file.FileException at C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(3153):
>>
>> It is very annoying when the only error info I have is 
>> pointing to code in a library which tells me absolutely 
>> nothing about where the error occurs in the in the user 
>> code(which is what matters).
>>
>>
>> Surely the call stack can be unrolled to find code that exists 
>> in the user code? Or at least display several lines like a 
>> trace stack.
>
> Not getting a stack trace? What platform are you on and what's 
> the command line you used to compile?

I get the main exception. Using windows x86 and visual D with 
it's default command line and in debug mode.

It seems these are "first chance exceptions" and that they seem 
to cause multiple problems.


This is the only kind of error I get

std.file.FileException at C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(3153): test.txt: Access is denied.
----------------
0x000B043A
0x000B0356
0x000A2899
0x000A2CC0
0x000A2CC0
0x000A2CC0
0x000A2CC0
0x000A11EF
0x000BD0EF
0x000BD06D
0x000BCF01
0x000B2EA8
0x00113B5E
0x00113A51
0x001138FD
0x00113BC8
0x76148744 in BaseThreadInitThunk
0x7795582D in RtlGetAppContainerNamedObjectPath
0x779557FD in RtlGetAppContainerNamedObjectPath




Which is about useless in helping me find the error when I use 
several file command.


More information about the Digitalmars-d mailing list