Rethrow an exception like in C++?
Rob T
alanb at ucora.com
Fri Mar 8 09:45:36 PST 2013
On Friday, 8 March 2013 at 09:01:29 UTC, Jacob Carlborg wrote:
> On 2013-03-08 08:34, Rob T wrote:
>> One more thing, we finally got __FUNCTION__ (and more) added
>> to MASTER
>> so that's another missing item that was sorely missed. Now we
>> can easily
>> log what functions are catching and throwing exceptions, and
>> more.
>>
>> The big question is if Throwable will be expanded to
>> automatically
>> capture the function signature (as it does with line and
>> file)? I hope
>> there are no major concerns over legacy code breakage and it
>> gets added in.
>
> I'm pretty sure there is no concerns. We could just add another
> overload of the constructor or add an additional default
> parameter. If a default parameter is added it needs to be added
> last, which would result some somewhat inconsistent order for
> the parameters. So I vote for a new overload.
Yes that is my choice as well, just add another overload to
Throwable and Exception. Exception has the default argument set
to __PRETTY_FUNCTION__ which is normally what you'd want to see.
--rt
More information about the Digitalmars-d-learn
mailing list