C++ Logo

std-proposals

Advanced search

Re: Stacktrace from exception

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Wed, 28 Apr 2021 20:05:41 +0300
On Wed, 28 Apr 2021 at 19:57, Edward Catmur <ecatmur_at_[hidden]> wrote:
>
> On Wed, 28 Apr 2021 at 17:06, Ville Voutilainen <ville.voutilainen_at_[hidden]> wrote:
>>
>> On Wed, 28 Apr 2021 at 18:42, Edward Catmur via Std-Proposals
>> <std-proposals_at_[hidden]> wrote:
>> > You're using exceptions in situations where you don't care about the stacktrace? Does that mean you're using exceptions as flow control?
>>
>> No. Current uses of exceptions are such that the exception type and
>> its data contain all the information necessary for callers to deal
>> with the exception,
>> the stacktrace information is irrelevant for that.
>
>
> It is necessary if you need it to be able to investigate the exception, and thus the caller needs to log it. In that case dealing with the exception requires having a stacktrace from throw point to handler.

Sure, fine, but there are many uses of exceptions (such as most
existing uses) that do not use a stacktrace, but that doesn't make
them flow control.

Received on 2021-04-28 12:05:56