Comparing Exceptions and Errors

Sebastiaan Koppe mail at skoppe.eu
Sat Jun 4 17:10:45 UTC 2022


On Saturday, 4 June 2022 at 01:17:28 UTC, Steven Schveighoffer 
wrote:
> If a thread does not catch an error and end the program, that's 
> a defect in druntime I think. If it tries to rethrow the 
> exception in the main thread (oh, man I have to check... Yeah, 
> this is what it does), then it's entirely possible that the 
> main thread will never even get to the `Error`!

Yes, for that reason, and others, people should not use that api.


>> If we are paranoid and want to do as little as possible, at 
>> least we should attempt to copy a string literal to stderr. 
>> Something like "Thread exiting with Error." And exit(1) right 
>> after that.
>
> Yes, that is what it should do.

Probably yes.



More information about the Digitalmars-d-learn mailing list