Discussing exception translation with GPT-5 mini: lazy void parameters

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Thu Apr 9 09:00:40 UTC 2026


On Wednesday, 8 April 2026 at 20:20:47 UTC, Forum User wrote:
> On Wednesday, 8 April 2026 at 07:33:56 UTC, Alexandru Ermicioi 
> wrote:
>> [...]
>> Small improvement: pass source exception into translated one, 
>> to not lose entire stack of exceptions.
>
> ```
> T translate (Ein, Eout, T) (lazy T t)
> {
>    try return t;
>    catch (Ein e) throw new Eout (e.msg, e.file, e.line, e);
> }
> ```
>
> right?
Yep,

Also if you dont plan to have custom message for translated 
Exception, then just include only original exception in the 
translated one. file line should be part of stack trace, so 
there's no need to pass them, as well as message from original 
exception.


More information about the Digitalmars-d mailing list