Silent error when using hashmap

FoxyBrown via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 26 20:06:44 PDT 2017


On Thursday, 27 July 2017 at 02:30:17 UTC, FatalCatharsis wrote:
> On Thursday, 27 July 2017 at 01:21:40 UTC, Steven Schveighoffer 
> wrote:
>> [...]
>
> This appears to be it. When an error is thrown, stdout does not 
> flush. When I put stdout.flush() immediately after the 
> writeln("start") at the beginning it is printed correctly. 
> However, when I try to catch the error and then do 
> stdout.flush() in main, it does not print.
>
> Do you know of a way to make D always flush the output buffer 
> when an error is thrown?
>
> On Thursday, 27 July 2017 at 01:05:28 UTC, ketmar wrote:
>> [...]
>
> Yes, I understand this. This is not my question. My question is 
> why all previous output to the console does not occur before 
> the error is thrown. As Steve said, this is because the output 
> buffer is not flushed when an error occurs.

I just noticed this without an exception. I changed my writeln's 
to write and printed a "\n" but it did not flush. Had to flush it 
manually. Not sure if that is by design or what.


More information about the Digitalmars-d mailing list